Explorar o código

samples will not generate negative f error anymore

Nima %!s(int64=11) %!d(string=hai) anos
pai
achega
ec13c4c36c

+ 1 - 1
examples/webgl_lights_hemisphere.html

@@ -84,7 +84,7 @@
 			void main() {
 
 				float h = normalize( vWorldPosition + offset ).y;
-				gl_FragColor = vec4( mix( bottomColor, topColor, max( pow( h, exponent ), 0.0 ) ), 1.0 );
+				gl_FragColor = vec4( mix( bottomColor, topColor, max( pow( max( h , 0.0), exponent ), 0.0 ) ), 1.0 );
 
 			}
 

+ 1 - 1
examples/webgl_materials_lightmap.html

@@ -58,7 +58,7 @@
 			void main() {
 
 				float h = normalize( vWorldPosition + offset ).y;
-				gl_FragColor = vec4( mix( bottomColor, topColor, max( pow( h, exponent ), 0.0 ) ), 1.0 );
+				gl_FragColor = vec4( mix( bottomColor, topColor, max( pow( max( h, 0.0 ), exponent ), 0.0 ) ), 1.0 );
 
 			}