Sfoglia il codice sorgente

Size attenuation flag applies to perspective projection only

WestLangley 7 anni fa
parent
commit
eabbd39aa9
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  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