Skip to content

EffectComposer: Add option for custom render pass #336

Description

@shotamatsuda

I've been trying MRT with EffectComposer in order to avoid additional render passes to output normals, masks, and so on. Extensibility is always a problem with pure components, but in this case, having a RenderPass prop in EffectComposer to accept a class implementing the same interface as RenderPass would allow us to use a custom render pass. Otherwise, and this is my current workaround, we must maintain a modified copy of EffectComposer, which is suboptimal in terms of maintainability.

Like:

exportconstEffectComposer=memo(forwardRef<EffectComposerImpl,EffectComposerProps>(({
...,
RenderPass =RenderPass},ref)=>{
...
const[composer,normalPass,downSamplingPass]=useMemo(()=>{
...
// Add render passeffectComposer.addPass(newRenderPass(scene,camera))...},[
...,RenderPass])...}))

I'd like to hear your opinion.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions