Skip to content

Sharing depth buffer between targets #15440

@pailhead

Description

@pailhead

I'm experimenting with an effect that uses the stencil buffer. I'd like to be able to share the depth/stencil render buffer between different targets.

It seems like i've been able to do what i want by changing this:

setupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );

to:

setupRenderBufferStorage( renderTarget.ownDepthBuffer || renderTargetProperties.__webglDepthbuffer, renderTarget )

and creating the buffer myself on the render target.

I am unable to find a way to do this without modifying the library. The super private caching internals seem to be in the way, since createRenderbuffer() is both called and stored inside the renderer.

I don't understand what exactly depthTexture is, but it seems like it is something similar to this, and can be provided from outside. Is there a way to achieve what i'm doing here without the hack?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions