Documentation: Clarify blend mode 'Writes to depth buffer' implications

Avatar
  • updated
  • Completed

While text is nice, a picture is worth a thousand words, and far more intuitive, especially for users that aren't super familiar with graphics terminology.

Specifically, for someone that isn't fairly familiar with graphics tech, the implications that stem from only the Opaque mode writing to the depth buffer, and how that relates to rendering order is not immediately obvious.

I think specifically this deserves a section that in one or two images very clearly illustrates what that means, namely that without writing to the depth buffer, lines drawn in immediate mode with Draw.Polylines or Draw.Line are draw-order specific, and you may see unexpected overlapping where lines that are far away will visually be drawn on top of lines that are closer to the camera, if the further lines were drawn later.

Edit: changed topic title to better reflect my original intent.

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline
Pinned replies
Avatar
Freya Holmér
  • Answer
  • Completed

I've now added a section on depth testing and draw order in the docs now, and I've added the blend mode section back to the gallery scene as of 3.0.1

Avatar
Freya Holmér

it's funny that I used to have this in the gallery scene but I accidentally deleted it somewhere in my version control, and now it's lost forever

Avatar
JohannesMP

Yeah, include that image (or something similar) in the documentation section on the modes would be useful, but also something I think many more users are familiar with if they've used photoshop, while polylines overlapping in unexpected ways is more specific to this domain specifically.

So I think I want to clarify this feature request specifically to focus on adding a section above the blend modes that clarifies what 'writing to the depth buffer' means and the implications that has in shapes.


Specifically showing how all of the non-opaque blend modes can result in unexpected layering, while opaque will not have that issue but also cannot have transparency (other than what is afforded by MSAA)

Avatar
Freya Holmér
  • Answer
  • Completed

I've now added a section on depth testing and draw order in the docs now, and I've added the blend mode section back to the gallery scene as of 3.0.1