Skip to content
Discussion options

You must be logged in to vote

Short answer: yes, this is possible — you need to write your compute-shader output to both a color attachment and a depth attachment, and then make sure your main 3D pass uses that depth texture as its depth input rather than a freshly-cleared one.

There are three ways to do it in Bevy 0.14+ depending on how much of the render pipeline you want to own:

1. Minimal: full-screen triangle pass that writes depth

This is usually what people actually want — the "sprite-ish with depth" look.

  1. Store your compute output as:
    • a TextureDimension::D2 color image (RGBA8)
    • a TextureDimension::D2 depth image (Depth32Float) built from your f32 array
  2. Create a custom RenderGraph node that runs before your …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by That-One-Axolotl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants