Skip to content

Commit ca224d2

Browse files
jfeldstemrdoob
authored andcommitted
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.  
1 parent 2a5db1e commit ca224d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/webgl_custom_attributes_particles3.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@
270270
for( var i = 0; i < attributes.size.value.length; i ++ ) {
271271

272272
if ( i < vc1 )
273-
attributes.size.value[ i ] = 26 + 32 * Math.sin( 0.1 * i + 0.6 * time );
273+
attributes.size.value[ i ] = Math.max(0, 26 + 32 * Math.sin( 0.1 * i + 0.6 * time ));
274274

275275

276276
}

0 commit comments

Comments
 (0)