mrdoob/three.js

backgroundNode color renders in the shadow map

Samsy opened this issue · 3 comments

Samsy commented

Description

When using :

scene.backgroundNode = new THREE.Color(0xff0000)

The background color renders in the shadow map

but also :

scene.background = new THREE.Color(0xff0000) does same effects

EDIT :

For some reasons, the backgroundNode allows THREE.Color as input, realised it is not a problem using color( 0xff000 ) from TSL color

Screenshot 2024-12-12 at 15 19 45

Live example

This fiddle display the shadow map texture in the center plane

Live fiddle

Version

r171

Device

Desktop

Browser

Chrome

OS

MacOS

Hey guys, looking at this issue, I was wondering if it's normal we can assign a Color to a node ?
Is it automatically convert to vec4() node ?

I was wondering if it's normal we can assign a Color to a node ?

You should assign nodes to node properties (properties that end with *Node). The current background behavior is confusing and should be fixed via #30169.

@Samsy I'll try to file an additional PR that fixes the shadow map bug. We have encountered the same issue some time ago in context of post processing.