Browse Source

Size attenuation flag applies to perspective projection only

WestLangley 7 years ago
parent
commit
eabbd39aa9
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/renderers/shaders/ShaderLib/sprite_vert.glsl

+ 3 - 1
src/renderers/shaders/ShaderLib/sprite_vert.glsl

@@ -19,7 +19,9 @@ void main() {
 
 	#ifndef USE_SIZEATTENUATION
 
-		scale *= abs( mvPosition.z );
+		bool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );
+
+		if ( isPerspective ) scale *= - mvPosition.z;
 
 	#endif