Skip to content

Commit ccf979e

Browse files
committed
RenderObject: Improve cache key computation when rendering shadows.
1 parent 86c3bd3 commit ccf979e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/renderers/common/RenderObject.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,9 +729,16 @@ class RenderObject {
729729
*/
730730
getDynamicCacheKey() {
731731

732-
// Environment Nodes Cache Key
732+
let cacheKey = 0;
733733

734-
let cacheKey = this._nodes.getCacheKey( this.scene, this.lightsNode );
734+
// `Nodes.getCacheKey()` returns an environment cache key which is no relevant when
735+
// the renderer is inside a shadow pass.
736+
737+
if ( this.material.isShadowNodeMaterial !== true ) {
738+
739+
cacheKey = this._nodes.getCacheKey( this.scene, this.lightsNode );
740+
741+
}
735742

736743
if ( this.object.receiveShadow ) {
737744

0 commit comments

Comments
 (0)