"description": "Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel",
"description": "In thick transmission mode: Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel\n\nIn thin transmission mode: This value modulates the distance traversed by light inside an object.",
"type": "float",
"defaultValue": 0.5,
"min": 0.0,
@ -1223,14 +1223,41 @@
"min": 0.0,
"softMax": 20.0
},
{
"name": "shrinkFactor",
"displayName": " Shrink Factor",
"description": "Shrink (absolute) offset towards the normal opposite direction to ensure correct shadow map projection",
"type": "float",
"defaultValue": 0.005,
"min": 0.0,
"softMax": 0.05
},
{
"name": "transmissionNdLBias",
"displayName": " Angle Bias",
"description": "cosine of angle to extend below (N . L = 0) in scattering through thin objects",
"type": "float",
"defaultValue": 0.1,
"min": -1.0,
"softMax": 1.0
},
{
"name": "distanceAttenuation",
"displayName": " Distance Attenuation",
"description": "Attenuation of the transmission effect, used to hide artifacts due to low-res shadow maps\nFor directional lights: attenuation proportional to the distance from the object to the camera.\nFor other light sources: attenuation proportional to the distance from the object to the light source.",
"description": "Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel",
"description": "In thick transmission mode: Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel\n\nIn thin transmission mode: This value modulates the distance traversed by light inside an object.",
"type": "float",
"defaultValue": 0.5,
"min": 0.0,
@ -637,14 +637,41 @@
"min": 0.0,
"softMax": 20.0
},
{
"name": "shrinkFactor",
"displayName": " Shrink Factor",
"description": "Shrink (absolute) offset towards the normal opposite direction to ensure correct shadow map projection",
"type": "float",
"defaultValue": 0.005,
"min": 0.0,
"softMax": 0.05
},
{
"name": "transmissionNdLBias",
"displayName": " Angle Bias",
"description": "cosine of angle to extend below (N . L = 0) in scattering through thin objects",
"type": "float",
"defaultValue": 0.1,
"min": -1.0,
"softMax": 1.0
},
{
"name": "distanceAttenuation",
"displayName": " Distance Attenuation",
"description": "Attenuation of the transmission effect, used to hide artifacts due to low-res shadow maps\nFor directional lights: attenuation proportional to the distance from the object to the camera.\nFor other light sources: attenuation proportional to the distance from the object to the light source.",
// Analytical integation (approximation) of diffusion profile over radius, could be precomputed in a LUT
// From d'Eon and Luebke (https://developer.nvidia.com/gpugems/gpugems3/part-iii-rendering/chapter-14-advanced-techniques-realistic-real-time-skin, section 14.4.7)
result = TransmissionKernel(thickness, invScattering) * falloff * lightIntensity * litRatio;
// transmissionDistance < 0.0f means shadows are not enabled --> avoid unnecessary computation
if (transmissionDistance < 0.0f)
{
break;
}
// Irradiance arround surface point.
// Albedo at front (surface point) is used to approximate irradiance at the back of the object (observation 4 in [Jimenez J. et al, 2010])
// Increase angle of influence to smooth transition regions
float3 E = surface.albedo * saturate(lightingData.transmissionNdLBias + dot(-surface.normal, dirToLight));
// Transmission distance modulated by hardcoded constant C and the thickness exposed parameter (in this case modulating the distance traversed by the light inside the object)
const float C = 300.0f;
float s = transmissionDistance * C * surface.transmission.thickness;
// Use scattering color to weight thin object transmission color
// How much is back face shadowed, it's set to the reverse of litRatio to share the same default value with thickness, which should be 0 if no shadow map available
float backShadowRatio = 0.0;
// Distance travelled by the light inside the object. If not redefined to a non-negative value, it will take the following behavior:
// - If transmission mode is thick object -> use transmission thickness parameter instead
// - If transmission mode is thin object -> ignore back lighting
// How much is back face shadowed, it's set to the reverse of litRatio to share the same default value with thickness, which should be 0 if no shadow map available
float backShadowRatio = 0.0;
// Distance travelled by the light inside the object. If not redefined to a non-negative value, it will take the following behavior:
// - If transmission mode is thick object -> use transmission thickness parameter instead
// - If transmission mode is thin object -> ignore back lighting