2
\$\begingroup\$

I am trying to create a transmittance or absorption shader (glsl, hlsl, cg, etc...) in realtime but I don't find any good tutorial or white paper about this subject. I only find offline rendering references.

Is it possible to achieve this kind of effect in realtime using standard rasterisation of a 3D mesh ? How ?

enter image description here

\$\endgroup\$
3
  • 1
    \$\begingroup\$ For pure transmittance (no scattering) you can first render the back faces to a depth buffer, then render the front faces using that depth buffer to find the thickness (sigma) at each point and then calculating the transmittance using the Beer-Lambert law. Of course, this will only work correctly in all cases for a convex object - you will have to use some kind of depth peeling or decomposition for complex objects like that statue. \$\endgroup\$
    – jmegaffin
    Oct 28 '14 at 18:19
  • \$\begingroup\$ Thank you for your answer, what do you mean by depth peeling or decomposition. I understand the problem but could you elaborate your solution ? Could you also elaborate your transmittance calculation ? \$\endgroup\$
    – MaT
    Oct 28 '14 at 19:10
  • 1
    \$\begingroup\$ Decomposition means that you need to split your mesh. Depth peeling is a multipass technique when you render a mesh layer by layer. The simple transmittance shader can be found here digitalerr0r.wordpress.com/2009/05/01/…. \$\endgroup\$ Oct 29 '14 at 11:43
1
\$\begingroup\$

You don't specify what rendering method you want to use. Standard rasterisation of a 3D mesh? Or do you have a volume representation of the model and your renderer uses that directly?

If you render a volume, check this:
http://http.developer.nvidia.com/GPUGems/gpugems_ch39.html

especially 39.2.

The effect in the picture you provide is mainly subsurface scattering. Here's a shader for real-time rendering:
http://www.iryoku.com/screen-space-subsurface-scattering

\$\endgroup\$
1
  • \$\begingroup\$ Thank you for you answer, I changed the question. I want to use standard rasterisation but I don't have any preference about the shader language. I already found some references about SSS but it seems that there's a little difference between SSS and absorption or transmittance but I couldn't tell what's this difference. \$\endgroup\$
    – MaT
    Oct 28 '14 at 14:34

You must log in to answer this question.

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