Explorar o código

Update examples/webgl_custom_attributes_particles3.html

The result for attributes.size.value[i] can be negative which in turn makes gl_PointSize negative. As an example if Math.sin(...) returns -1 then you'll get -6 as a result. The specification specifically states:"If the value written to gl_PointSize
is less than or equal to zero, results are undefined". In fact it is causing such a problem on our platform.
jfeldste %!s(int64=12) %!d(string=hai) anos
pai
achega
ca224d29a6
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      examples/webgl_custom_attributes_particles3.html

+ 1 - 1
examples/webgl_custom_attributes_particles3.html

@@ -270,7 +270,7 @@
 			for( var i = 0; i < attributes.size.value.length; i ++ ) {
 
 				if ( i < vc1 )
-					attributes.size.value[ i ] = 26 + 32 * Math.sin( 0.1 * i + 0.6 * time );
+					attributes.size.value[ i ] = Math.max(0, 26 + 32 * Math.sin( 0.1 * i + 0.6 * time ));
 
 
 			}