Explorar o código

WebGLRenderer: Recompile program when fog changes. Fixes #9384.

Mr.doob %!s(int64=9) %!d(string=hai) anos
pai
achega
ff4eb5bc10
Modificáronse 1 ficheiros con 13 adicións e 0 borrados
  1. 13 0
      src/renderers/WebGLRenderer.js

+ 13 - 0
src/renderers/WebGLRenderer.js

@@ -1631,6 +1631,12 @@ function WebGLRenderer( parameters ) {
 
 		}
 
+		if ( material.fog ) {
+
+			materialProperties.fog = fog;
+
+		}
+
 		if ( material.lights ) {
 
 			// store the light setup it was created for
@@ -1729,6 +1735,13 @@ function WebGLRenderer( parameters ) {
 
 		}
 
+		if ( materialProperties.fog !== undefined &&
+			materialProperties.fog !== fog ) {
+
+				material.needsUpdate = true;
+
+		}
+
 		if ( materialProperties.lightsHash !== undefined &&
 			materialProperties.lightsHash !== _lights.hash ) {