Skip to content

Effects / passes are not guaranteed to be constructed in the order composed #306

@gkjohnson

Description

@gkjohnson

I noticed this when working on another project but when adding, removing, then readding (or basically having to reconstruct a effect) single effect it's not guaranteed to show up in the effect layering in the same order as composed.

Here's a simple example showing the issue based on the CSB from the README. The effects are composed like so:

<EffectComposer ...>
        <ToneMapping mode={ToneMappingMode.AgXToneMapping} />
        <DepthOfField .../>
</EffectComposer>

but when logging the effects in the effect pass they are constructed in the following order:

['DepthOfFieldEffect', 'ToneMappingEffect']

I suspect it may have something to do with these lines and the use of the internal useInstanceHandle to get access to the child effect which may not return the children in a consistent order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions