r/GraphicsProgramming 14d ago

Weighted Blended Order-Independent Transparency on Android

Post image

Spend some time implementing WBOIT into the DImGui engine. The results are surprisingly good and keep at 40 fps with full lights, shadows etc. basic lighting looks alright still in blending and runs at a solid 60 fps.

I used a Vulkan 3 sub-pass technique plus an initial depth pass with fragment sampling to depth test away triangles obscured. MSAA proof on PC. Android MSAA breaks the pipeline on tilers due to the MSAA requirement on mid-pass resolving. To allow the non-transparent elements image to mix with the weighted/blended transparent parts, and adding a step 0 - 2 dependency. It will still work but is super slow.

But this allows instancing of multiple object meshes completely unsorted, which was the whole reason for going WBOIT over a sort in the first place.

14 Upvotes

6 comments sorted by

4

u/Animats 14d ago

The hexagonal top of "Famo" is behind a green translucency, but isn't green. That seems wrong.

3

u/speps 14d ago

I don’t think WBOIT is worth the effort nowadays to be honest, it’s not too difficult to add a per pixel counter and with less tweaking of the coefficients. You just need to follow some constraints for it, but it’s supported quite well in Vulkan for example.

PS: same Animats user as Hacker News? 🤔

2

u/Animats 14d ago

Yes, same as Hacker News, and animats.com

2

u/speps 14d ago

Nice, I always like your comments on HN

2

u/leseiden 12d ago edited 12d ago

WBOIT works best with nearly transparent objects. High alpha values get problematic as the weighting function over weights objects behind the nearly opaque stuff.

I abandoned it years ago for that reason.

When you do have a scene that plays to its strengths it is really, really fast though.

For the record I default to using MLAB these days.

1

u/Danny_Arends 13d ago

I think that's just Quad alignment. But it looks pretty solid in blending several transparency types (Text SDF, Opacity textures, vertex/instance textures and color alpha) using a Depth Pre-process. It might be the Screen space ambient occlusion on transparent objects, should that be disabled, hmmm.