From 2208e8126a7c251fcfa95f3bdc752c22c8c6511c Mon Sep 17 00:00:00 2001 From: WestLangley Date: Tue, 17 Sep 2024 04:00:01 -0400 Subject: [PATCH] Simplify shader (#29397) --- src/renderers/shaders/ShaderLib/sprite.glsl.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/renderers/shaders/ShaderLib/sprite.glsl.js b/src/renderers/shaders/ShaderLib/sprite.glsl.js index 83e754d8a47922..ed04dda453788f 100644 --- a/src/renderers/shaders/ShaderLib/sprite.glsl.js +++ b/src/renderers/shaders/ShaderLib/sprite.glsl.js @@ -12,11 +12,9 @@ void main() { #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec4 mvPosition = modelViewMatrix[ 3 ]; - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); #ifndef USE_SIZEATTENUATION