Skip to content

Honor camera layers on light.shadow.camera for selective shadow #30156

@Samsy

Description

@Samsy

Description

In order to build a selective real time shadow along with a baked shadow system the light.shadow.camera should honor the layers to be tested against an object to render the shadow

I did add support on a custom build of the WebGLRenderer and this was very handy

Here an example disabling all the layers for the shadow camera but still renders :

Live Link

Solution

Before rendering the shadow, the mask is copied from the main render camera, wondering if this copy is mandatory, and if we could go with manually setting the layers instead for more controls, or maybe provide a solution to play with the shadow.camera layer without being overwritten :

shadow.camera.layers.mask = camera.layers.mask;

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions