Remove thickness + refactor scale parameter influence
Signed-off-by: Santi Paprika <santi.gonzalez.cs@gmail.com>
This commit is contained in:
@@ -1254,9 +1254,9 @@
|
|||||||
"displayName": " Scale",
|
"displayName": " Scale",
|
||||||
"description": "Strength of transmission",
|
"description": "Strength of transmission",
|
||||||
"type": "float",
|
"type": "float",
|
||||||
"defaultValue": 3.0,
|
"defaultValue": 0.01,
|
||||||
"min": 0.0,
|
"min": 0.0,
|
||||||
"softMax": 100.0
|
"softMax": 1.0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"detailLayerGroup": [
|
"detailLayerGroup": [
|
||||||
|
|||||||
@@ -668,9 +668,9 @@
|
|||||||
"displayName": " Scale",
|
"displayName": " Scale",
|
||||||
"description": "Strength of transmission",
|
"description": "Strength of transmission",
|
||||||
"type": "float",
|
"type": "float",
|
||||||
"defaultValue": 3.0,
|
"defaultValue": 0.01,
|
||||||
"min": 0.0,
|
"min": 0.0,
|
||||||
"softMax": 100.0
|
"softMax": 1.0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"wrinkleLayers": [
|
"wrinkleLayers": [
|
||||||
|
|||||||
@@ -65,18 +65,18 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI
|
|||||||
|
|
||||||
{
|
{
|
||||||
// Irradiance arround surface point.
|
// Irradiance arround surface point.
|
||||||
// Begin the transmittance dot product slightly before it would with the regular dot(N,L)
|
// Increase angle of influence (angle(N,L) -> angle(N,L) + acos(angleOffset)) to smoothen transition regions
|
||||||
float E = max(lightingData.angleOffset + dot(-surface.normal, dirToLight),0.0);
|
float3 E = surface.albedo * max(lightingData.angleOffset + dot(-surface.normal, dirToLight),0.0);
|
||||||
|
|
||||||
// Transmission distance computed from shadowmaps modulated by editor-exposed parameters
|
// Transmission distance modulated by editor-exposed scale parameter
|
||||||
float s = transmissionDistance * surface.transmission.thickness * (100 - transmissionParams.w);
|
float s = transmissionDistance / (transmissionParams.w * transmissionParams.w);
|
||||||
|
|
||||||
// Use scattering color to weight thin object transmission color
|
// Use scattering color to weight thin object transmission color
|
||||||
const float3 invScattering = rcp(transmissionParams.xyz);
|
const float3 invScattering = rcp(transmissionParams.xyz);
|
||||||
|
|
||||||
// Albedo at front (surface point) is used to approximate irradiance at the back of the object
|
// Albedo at front (surface point) is used to approximate irradiance at the back of the object
|
||||||
// See observation 4 in [Jimenez J. et al, 2010]
|
// See observation 4 in [Jimenez J. et al, 2010]
|
||||||
result = TransmissionKernel(s, invScattering) * lightIntensity * surface.albedo * E;
|
result = TransmissionKernel(s, invScattering) * lightIntensity * E;
|
||||||
// result = T(s) * lightIntensity * surface.albedo * E;
|
// result = T(s) * lightIntensity * surface.albedo * E;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user