1
\$\begingroup\$

So, this is a bit of a simple question, but I can't seem to find a real answer anywhere. I've been looking into implementing deferred rendering using MRT into my in-progress render engine, but I'm a bit hesitant to for the following reason.

I've read in a few places now that deferred shading does not support transparency natively, and if I wanted to achieve transparency, I would need to resort to forward shading of these transparent objects. But, the idea of "transparency" seems a bit vague because it seems as if there might (corrct me if I'm wrong) be two types of transparency.

One type being the sort of overlay transparency, where I, say, tile a wall with a brick texture. Then I want the wall to be 50% transparent so I apply that on top of the already textured object. This appears to be one "mode" transparency in which the engine, as part of its rendering pipeline, inserts this transparency manually.

The next type in my mind is using a texture that already has an alpha value associated with it, i.e. a 256x256 image of a person, where everything that isn't the person has an alpha value of zero. Then, if I were to billboard that image of the man onto a simple quad (which is what I'm actually trying to do in my game, for reference), would that sort of "native" transparency on the parts of the image with zero alpha still render as transparent, even in a deferred rendering situation?

Does such a distinction exist between these two types of transparency, or are they merely two sides of the same coin when it comes to deferred rendering?

\$\endgroup\$
  • 1
    \$\begingroup\$ To add a bit more precision for your example of the person: do you want to render only fully opaque or fully transparent pixels, with no falloff or feathering translucency in-between? This you can do with "alpha testing" in a way that's compatible with deferred rendering (although the edges tend to look sharp & aliased). If you want soft translucency though — pixels where you see both a bit of the person and a bit of what's behind them, like feathered edges — that's where you need a different solution. \$\endgroup\$ – DMGregory Jan 11 '17 at 22:20
3
\$\begingroup\$

They're both the same thing, in that they both require anything visible through the transparent portions of the surface to have been rendered already, so they can be available in the framebuffer for blending with the transparent surface as it is rendered.

Traditional deferred rendering effectively only stores the "front-most" pixels, the ones for the transparent surface in this case. But since the data for what was behind those transparent pixels is lost, the transparency cannot be resolved with traditional deferred rendering.

So it doesn't matter that you use alpha data in textures to compute transparency, or if you flat-out decide "this entire model will be 50% transparent." Neither works with traditional deferred rendering.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.