From 116641acbdeb864e9ad10d05f49c2d6f607d941a Mon Sep 17 00:00:00 2001 From: jfeldste Date: Mon, 19 Nov 2012 14:50:31 -0500 Subject: [PATCH] Update examples/webgl_custom_attributes_particles3.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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.   --- examples/webgl_custom_attributes_particles3.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/webgl_custom_attributes_particles3.html b/examples/webgl_custom_attributes_particles3.html index cace8397b9e041..830c37a4572afa 100644 --- a/examples/webgl_custom_attributes_particles3.html +++ b/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 )); }