Skip to content

Commit

Permalink
Update examples/webgl_custom_attributes_particles3.html
Browse files Browse the repository at this point in the history
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.
 
  • Loading branch information
jfeldste authored and mrdoob committed Nov 19, 2012
1 parent 2a5db1e commit ca224d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/webgl_custom_attributes_particles3.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 ));


}
Expand Down

0 comments on commit ca224d2

Please sign in to comment.