diff --git a/src/nodes/accessors/SceneProperties.js b/src/nodes/accessors/SceneProperties.js index cea87c6968eec1..14e977921d8baf 100644 --- a/src/nodes/accessors/SceneProperties.js +++ b/src/nodes/accessors/SceneProperties.js @@ -31,7 +31,7 @@ export const backgroundRotation = /*@__PURE__*/ uniform( new Matrix4() ).setGrou const background = scene.background; - if ( background !== null && background.isTexture && background.mapping !== UVMapping ) { + if ( ( background !== null && background.isTexture && background.mapping !== UVMapping ) || ( scene.backgroundNode && scene.backgroundNode.isNode ) ) { // note: since the matrix is orthonormal, we can use the more-efficient transpose() in lieu of invert() _m1.makeRotationFromEuler( scene.backgroundRotation ).transpose(); diff --git a/src/nodes/core/MRTNode.js b/src/nodes/core/MRTNode.js index b6d46ba751ef1f..eaf54b6bcd4f9e 100644 --- a/src/nodes/core/MRTNode.js +++ b/src/nodes/core/MRTNode.js @@ -170,6 +170,10 @@ class MRTNode extends OutputStructNode { for ( const name in outputNodes ) { const index = getTextureIndex( textures, name ); + + // Ignore if the output exists in the MRT but has never been used. + if ( index === - 1 ) continue; + const type = builder.getOutputType( index ); members[ index ] = outputNodes[ name ].convert( type );