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