瀏覽代碼

Size attenuation flag applies to perspective projection only

WestLangley 7 年之前
父節點
當前提交
eabbd39aa9
共有 1 個文件被更改,包括 3 次插入1 次删除
  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