Explorar o código

point size attenuation fix

omgitsraven %!s(int64=9) %!d(string=hai) anos
pai
achega
0baa0ed0b0
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      examples/webgl_custom_attributes_points2.html

+ 1 - 2
examples/webgl_custom_attributes_points2.html

@@ -49,8 +49,7 @@
 
 				vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
 
-				//gl_PointSize = size;
-				gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) );
+				gl_PointSize = size * ( 300.0 / -mvPosition.z );
 
 				gl_Position = projectionMatrix * mvPosition;