Jelajahi Sumber

point size attenuation fix

omgitsraven 9 tahun lalu
induk
melakukan
cede75c531
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      examples/webgl_custom_attributes_points3.html

+ 1 - 1
examples/webgl_custom_attributes_points3.html

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