Browse Source

Merge pull request #14442 from sunag/dev-fix-onBeforeCompile

fix change code after onBeforeCompile ( sharing old code )
Mr.doob 7 years ago
parent
commit
b43193e099
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/renderers/WebGLRenderer.js

+ 2 - 0
src/renderers/WebGLRenderer.js

@@ -1475,6 +1475,8 @@ function WebGLRenderer( parameters ) {
 
 			material.onBeforeCompile( materialProperties.shader, _this );
 
+			code = programCache.getProgramCode( material, parameters );
+
 			program = programCache.acquireProgram( material, materialProperties.shader, parameters, code );
 
 			materialProperties.program = program;