Colin BarreBrisebois Programming ApproximatingTranslucency
Colin BarreBrisebois Programming ApproximatingTranslucency
Approximating Translucency
for a Fast, Cheap and Convincing
Subsurface Scattering Look
Fig. 2 – Translucency in Athena Statue (left) [BarréBrisebois11], and child’s hand (right)
Translucency in Computer
Graphics
• We rely heavily on BRDFs for describing local
reflections
– Simple and effective for opaque objects
• However, many objects in nature are (partly)
translucent
– Light transport also happens within the surface
– BRDFs are not sufficient
• BSSRDFs allow for an even better simulation
– But are usually more/too expensive
• In our case, we chose BSDFs (BRDF + BTDF),
with some elements of BSSRDF
Fig. 3 – BRDF, BTDF and BSSRDF
The State of Translucency
Real-time translucency and derivatives come in
different
flavors:
• The more complex, but (relatively) expensive
– [Chang08] Texture-space Importance Sampling
– [Hable09] Texture-space Diffusion blurs, for skin / SSS
– [Ki09] Shadowmap-based Translucency / SSS
fLTAmbient
• Ambient value
• Visible from all angles
• Representing both front and back
translucency that is always present
Fig. 14 – Ambient Term
Managing the Data at Runtime
(cont.)
half3 vLTLight = vLight + vNormal * fLTDistortion;
half fLTDot = pow(saturate(dot(vEye, -vLTLight)), iLTPower) *
fLTScale;
half3 fLT = fLightAttenuation * (fLTDot + fLTAmbient) *
fLTThickness;
outColor.rgb += cDiffuseAlbedo * cLightDiffuse * fLT;
iLTPower
• Power value for direct translucency
• Breaks continuity, view-dependent
• Can be optimized with pre-computed
powers
Fig. 16 – Power (4/Left, 12/Right) Term
Managing the Data at Runtime
(cont.)
half3 vLTLight = vLight + vNormal * fLTDistortion;
half fLTDot = pow(saturate(dot(vEye, -vLTLight)), iLTPower) *
fLTScale;
half3 fLT = fLightAttenuation * (fLTDot + fLTAmbient) *
fLTThickness;
outColor.rgb += cDiffuseAlbedo * cLightDiffuse * fLT;
fLTDistortion
• Subsurface Distortion
• Shifts the surface normal
• Breaks continuity, view-dependent
Allows for more organic, Fresnel-like
Fig. 17 – Distortion (None/Left, 0.2/Right) Term
Managing the Data at Runtime
(cont.)
half3 vLTLight = vLight + vNormal * fLTDistortion;
half fLTDot = pow(saturate(dot(vEye, -vLTLight)), iLTPower) *
fLTScale;
half3 fLT = fLightAttenuation * (fLTDot + fLTAmbient) *
fLTThickness;
outColor.rgb += cDiffuseAlbedo * cLightDiffuse * fLT;
fLTThickness
• Pre-computed Local Thickness Map
• Used for both direct and indirect
translucency
• Attenuates the computation where
surface thickness varies Fig. 18 – Local Thickness
Managing the Data at Runtime
(cont.)
half3 vLTLight = vLight + vNormal * fLTDistortion;
half fLTDot = pow(saturate(dot(vEye, -vLTLight)), iLTPower) *
fLTScale;
half3 fLT = fLightAttenuation * (fLTDot + fLTAmbient) *
fLTThickness;
outColor.rgb += cDiffuseAlbedo * cLightDiffuse * fLT;
fLTScale
• Scale value
• Direct / Back translucency
• View-oriented
• Should be defined per-light. This
Fig. 15 – Scale (1/Left, 5/Right) Term
All-Together
Based on your game, this can be enough. The color will then only
originate
Deferred Shading G-Buffer Setup
(cont.)
Blue Light
White Albedo
White
Fig. 22 – Real-Time Translucency in Frostbite 2
Performance
XBOX 360 PLAYSTATION 3 PC (DX11)
Full-Screen Coverage 0.6 ms 1.0 ms 0.03 ms
Instructions 13 17 12