-
-
Notifications
You must be signed in to change notification settings - Fork 36.2k
Description
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:
three.js/src/renderers/webgl/WebGLTextures.js
Line 814 in b2ca569
| 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?