Просмотр исходного кода

samples will not generate negative f error anymore

Nima 11 лет назад
Родитель
Сommit
ec13c4c36c
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      examples/webgl_lights_hemisphere.html
  2. 1 1
      examples/webgl_materials_lightmap.html

+ 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 );
 
 			}