Extend the current RenderTarget implementation to support writing to multiple textures simultaneously. This is a core WebGL2 feature that allows a single fragment shader pass to output different data (e.g., color, normals, depth) to separate buffers.
Key Requirements:
- Update
createRenderTarget to support an array of textures or parameter sets.
- Implement
gl.drawBuffers() within setRenderTarget to enable multiple attachments.
- Update
useRenderPass or the shader initialization to handle layout(location = n) out vec4 pc_fragColor; syntax in GLSL.
- Ensure
RenderTarget exposes all attached textures for use as uniforms in subsequent passes.
Use Case:
Essential for deferred rendering pipelines, G-buffer generation, and complex post-processing effects.
Extend the current
RenderTargetimplementation to support writing to multiple textures simultaneously. This is a core WebGL2 feature that allows a single fragment shader pass to output different data (e.g., color, normals, depth) to separate buffers.Key Requirements:
createRenderTargetto support an array of textures or parameter sets.gl.drawBuffers()withinsetRenderTargetto enable multiple attachments.useRenderPassor the shader initialization to handlelayout(location = n) out vec4 pc_fragColor;syntax in GLSL.RenderTargetexposes all attached textures for use as uniforms in subsequent passes.Use Case:
Essential for deferred rendering pipelines, G-buffer generation, and complex post-processing effects.