Skip to content

Support shadow mapping with reverse Z #29770

@prideout

Description

@prideout

Description

To repro, modify examples/webgl_shadowmap.html by passing reverseDepthBuffer: true into the WebGLRenderer constructor.

To get anything to render at all, you will also need to add renderer.getContext().clearDepth(0) (see my comment in #29579).

After these modifications, the demo looks okay except that there are no shadows.

Solution

Ideally shadow mapping is supported without requiring clients to write any extra code, since DepthBuffer in WebGLState already flips the depth function & depth clear value at a low level. I have not yet been able to find the missing piece.

Alternatives

Alternatively, maybe the onus is on the applications to handle this in the onBeforeShadow hook?

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions