Skip to content

Stencil support: Change CORE_3D_DEPTH_FORMAT to Depth24PlusStencil8 #21358

Description

@raketenben

What problem does this solve or what need does it fill?

Bevy currently uses Depth32 as the texture format for the depth buffer, necessitating a modified version of bevy to properly utilize stencils with respect to depth of other scene meshes.

This seems like an important feature to have in bevy, it should be considered sooner rather than later, to avoid larger refactors for this functionality down the line.

What solution would you like?

Changing CORE_3D_DEPTH_FORMAT from TextureFormat;:Depth32 to TextureFormat::Depth24PlusStencil8, should get it most of the way there, enabling third party crates to add further stencil functionality.

In the long term, it would be nice to allow materials or meshes to set a stencil reference, as well as the ability to pass a custom DepthStencilState to the mesh render pipeline in some way.

What alternative(s) have you considered?

If this can not be set as the default depth format, there should be an option to change the depth texture format for the specific application.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-FeatureA new feature, making something new possibleS-Waiting-on-AuthorThe author needs to make changes or address concerns before this can be merged

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions