Sfoglia il codice sorgente

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

add renderer prop in onBeforeCompile
Mr.doob 7 anni fa
parent
commit
6c2d00a48d
2 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  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].
 		</div>
 
-		<h3>[method:null onBeforeCompile]()</h3>
+		<h3>[method:null onBeforeCompile]( [param:Object shader], [param:WebGLRenderer renderer] )</h3>
 		<div>
 		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.

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