Provide a way to attach and read back depth or stencil data from a RenderTarget. Currently, usegl creates a default color attachment but doesn't expose the depth buffer as a readable texture.
Key Requirements:
- Add
depthTexture and stencilTexture options to RenderTargetParams.
- Support internal formats like
DEPTH_COMPONENT24, STENCIL_INDEX8, or DEPTH24_STENCIL8.
- Enable the use of
gl.DEPTH_ATTACHMENT and gl.STENCIL_ATTACHMENT during FBO creation.
- Ensure these textures can be bound as uniforms in other shader passes.
Use Case:
Required for shadow mapping, Screen Space Ambient Occlusion (SSAO), depth-of-field, and any shader effect that requires distance-from-camera information.
Provide a way to attach and read back depth or stencil data from a
RenderTarget. Currently,useglcreates a default color attachment but doesn't expose the depth buffer as a readable texture.Key Requirements:
depthTextureandstencilTextureoptions toRenderTargetParams.DEPTH_COMPONENT24,STENCIL_INDEX8, orDEPTH24_STENCIL8.gl.DEPTH_ATTACHMENTandgl.STENCIL_ATTACHMENTduring FBO creation.Use Case:
Required for shadow mapping, Screen Space Ambient Occlusion (SSAO), depth-of-field, and any shader effect that requires distance-from-camera information.