Răsfoiți Sursa

Merge pull request #13362 from sunag/91dev-shadercompile

add renderer prop in onBeforeCompile
Mr.doob 8 ani în urmă
părinte
comite
6c2d00a48d
2 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 1 1
      docs/api/materials/Material.html
  2. 1 1
      src/renderers/WebGLRenderer.js

+ 1 - 1
docs/api/materials/Material.html

@@ -308,7 +308,7 @@
 		These needs to be disposed by [page:Texture Texture].
 		These needs to be disposed by [page:Texture Texture].
 		</div>
 		</div>
 
 
-		<h3>[method:null onBeforeCompile]()</h3>
+		<h3>[method:null onBeforeCompile]( [param:Object shader], [param:WebGLRenderer renderer] )</h3>
 		<div>
 		<div>
 		An optional callback that is executed immediately before the shader program is compiled.
 		An optional callback that is executed immediately before the shader program is compiled.
 		This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
 		This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.

+ 1 - 1
src/renderers/WebGLRenderer.js

@@ -1513,7 +1513,7 @@ function WebGLRenderer( parameters ) {
 
 
 			}
 			}
 
 
-			material.onBeforeCompile( materialProperties.shader );
+			material.onBeforeCompile( materialProperties.shader, _this );
 
 
 			program = programCache.acquireProgram( material, materialProperties.shader, parameters, code );
 			program = programCache.acquireProgram( material, materialProperties.shader, parameters, code );
 
 

粤ICP备19079148号