Skip to content

Incorrect use of depth texture attachments #225

@vanruesc

Description

@vanruesc

Description of the bug

The current depth texture system assumes that a depth texture can be assigned to a render target at any time. This assumption is incorrect as render targets are initialized once when they are used. Certain pass chains will cause the internal frame buffer to be initialized with a basic depth buffer attachment and the subsequent assignment of a depth texture won't have any effect. As a result, the depth texture won't contain the depth information of the rendered scene.

To Reproduce

  1. Add a ClearPass to the composer.
  2. Add a RenderPass to the composer.
  3. Add an EffectPass containing a depth-based effect such as SSAOEffect to the composer.
  4. See the effect fail due to missing depth information.

Expected behavior

Depth-based effects shouldn't fail with certain pass chains. One potential solution would be to assign the depth texture to a dedicated render target for geometry passes. Going one step further, a more complex render target management system could be implemented to allow passes to explicitly define input and output buffers.

Library versions used

  • Three: 0.120.0
  • Post Processing: 6.17.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    v6Relates to version 6

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions