Quellcode durchsuchen

point size attenuation fix

omgitsraven vor 9 Jahren
Ursprung
Commit
ec3c380a00
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      examples/webgl_buffergeometry_custom_attributes_particles.html

+ 1 - 1
examples/webgl_buffergeometry_custom_attributes_particles.html

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