diff --git a/examples/jsm/nodes/materials/nodes/StandardNode.js b/examples/jsm/nodes/materials/nodes/StandardNode.js index 5fc2d2d99efe500b60141dc96fb05173939864c8..ae7f70779a738afe1f4121c6bfc52cda3c6d4c54 100644 --- a/examples/jsm/nodes/materials/nodes/StandardNode.js +++ b/examples/jsm/nodes/materials/nodes/StandardNode.js @@ -156,9 +156,15 @@ StandardNode.prototype.build = function ( builder ) { if ( this.environment ) { // isolate environment from others inputs ( see TextureNode, CubeTextureNode ) + // environment.analyze will detect if there is a need of calculate irradiance this.environment.analyze( builder, { cache: 'radiance', context: contextEnvironment, slot: 'radiance' } ); - this.environment.analyze( builder, { cache: 'irradiance', context: contextEnvironment, slot: 'irradiance' } ); + + if ( builder.requires.irradiance ) { + + this.environment.analyze( builder, { cache: 'irradiance', context: contextEnvironment, slot: 'irradiance' } ); + + } }