7
\$\begingroup\$

I've seen somewhere rendering technique that allows order-less rendering of partially transparent sprites/objects.

Though I can't remember what the technique is called, so I'm having trouble Googling it.

\$\endgroup\$
3
  • \$\begingroup\$ Blending? \$\endgroup\$
    – House
    Commented Nov 12, 2012 at 19:04
  • \$\begingroup\$ Order-independent transparency? That's not really a technique though, and no technique under this group of effects doesn't even give a 100% correct result. \$\endgroup\$
    – snake5
    Commented Nov 12, 2012 at 21:33
  • \$\begingroup\$ @Byte56 Just blending won't work if you draw further plane after the nearer, I'm looking for order-independent :) \$\endgroup\$
    – kravemir
    Commented Nov 13, 2012 at 18:26

2 Answers 2

13
\$\begingroup\$

There are lots of ways to achieve order-independent transparency.

The first (and I think oldest) type of algorithm is called depth peeling and works by "peeling" one transparency layer per pass (in the most basic version). This Nvidia paper for Dual Depth Peeling shows peeling two layers at the same time.

The second type which I only know as "order-independent transparency" (or OIT) works by storing transparent fragments during rendering (e.g. in a linked list) and then sorting them via compute shader. An example is contained in the DirectX 11 SDK, another (and lots of links) is here.

The next thing I remember is Order Independent Translucency which stores fragments by hijacking MSAA.

And last but not least there is a sample for Stochastic Transparency in the latest NVIDIA Graphics SDK 11 Direct3D

Hope this contains the algorithm you searched for.

\$\endgroup\$
4
  • 3
    \$\begingroup\$ The per-pixel linked list is often called an A-buffer. The Humus article you linked to refers to the technique it describes as "stencil-routed A-buffer". Also worth mentioning is Marco Salvi's adaptive transparency, which is a per-pixel fragment list that intelligently discards fragments to keep the list under a fixed size without introducing too much error. \$\endgroup\$ Commented Nov 13, 2012 at 0:13
  • 1
    \$\begingroup\$ The actual oldest technique is screendoor transparency, which is still used in some console and mobile games due to its very high performance with modest hardware. \$\endgroup\$ Commented Nov 13, 2012 at 2:46
  • \$\begingroup\$ Seems I forgot screendoor transparency, thanks Sean. Also the related Alpha to coverage, which works like screendoor transparency, only on subpixel level. \$\endgroup\$
    – Jens Nolte
    Commented Nov 13, 2012 at 15:49
  • 2
    \$\begingroup\$ @NathanReed Thanks for providing the Adaptive Transparency link, I didn't know this and it totally looks worth investigating. Maybe my engine soon supports OIT :) \$\endgroup\$
    – Jens Nolte
    Commented Nov 13, 2012 at 15:54
11
\$\begingroup\$

Jens covered the different ways pretty well. I would like to add that additive blending is also order independent and it can be used in limited use cases to achieve pretty good results with very little programming effort.

The following image is rendered with a color something like (-0.5, 1.0, -0.5) with additive blending. Positive color values are given for one color channel and negative values for the other two channels to not increase the average brightness.

Simultaneous additive and subtractive blending

\$\endgroup\$
1
  • 8
    \$\begingroup\$ Whoa, additive blending with negative values? Never thought of that. \$\endgroup\$
    – API-Beast
    Commented Nov 13, 2012 at 15:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .