Skip to content

Commit

Permalink
add global material compile hook, env intensity
Browse files Browse the repository at this point in the history
  • Loading branch information
ligaofeng committed Oct 30, 2023
1 parent 4ce8559 commit 065eb6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1640,6 +1640,10 @@ class WebGLRenderer {

material.onBeforeCompile( parameters, _this );

if (_this.onMaterialBeforeCompile) {

Check failure on line 1643 in src/renderers/WebGLRenderer.js

View workflow job for this annotation

GitHub Actions / Lint testing

There must be a space after this paren

Check failure on line 1643 in src/renderers/WebGLRenderer.js

View workflow job for this annotation

GitHub Actions / Lint testing

There must be a space before this paren

Check failure on line 1643 in src/renderers/WebGLRenderer.js

View workflow job for this annotation

GitHub Actions / Lint testing

Block must be padded by blank lines
_this.onMaterialBeforeCompile(material, parameters);

Check failure on line 1644 in src/renderers/WebGLRenderer.js

View workflow job for this annotation

GitHub Actions / Lint testing

There must be a space after this paren

Check failure on line 1644 in src/renderers/WebGLRenderer.js

View workflow job for this annotation

GitHub Actions / Lint testing

There must be a space before this paren

Check failure on line 1644 in src/renderers/WebGLRenderer.js

View workflow job for this annotation

GitHub Actions / Lint testing

Block must be padded by blank lines
}

program = programCache.acquireProgram( parameters, programCacheKey );
programs.set( programCacheKey, program );

Expand Down
2 changes: 1 addition & 1 deletion src/renderers/webgl/WebGLMaterials.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ function WebGLMaterials( renderer, properties ) {
if ( envMap ) {

//uniforms.envMap.value = material.envMap; // part of uniforms common
uniforms.envMapIntensity.value = material.envMapIntensity;
uniforms.envMapIntensity.value = material.envMapIntensity * ( renderer.envMapIntensity === undefined ? 1 : renderer.envMapIntensity );

}

Expand Down

0 comments on commit 065eb6d

Please sign in to comment.