Increase scale range + expose shrink factor
Signed-off-by: Santi Paprika <santi.gonzalez.cs@gmail.com>
This commit is contained in:
@@ -142,7 +142,7 @@ VSOutput SkinVS(VSInput IN)
|
||||
const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight;
|
||||
DirectionalLightShadow::GetShadowCoords(
|
||||
shadowIndex,
|
||||
worldPosition - 0.005 * OUT.m_normal,
|
||||
worldPosition - MaterialSrg::m_shrinkFactor * OUT.m_normal,
|
||||
OUT.m_normal,
|
||||
OUT.m_shrinkedShadowCoords);
|
||||
|
||||
|
||||
@@ -637,6 +637,19 @@
|
||||
"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,
|
||||
"connection": {
|
||||
"type": "ShaderInput",
|
||||
"name": "m_shrinkFactor"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "transmissionScale",
|
||||
"displayName": " Scale",
|
||||
|
||||
@@ -71,6 +71,7 @@ ShaderResourceGroup MaterialSrg : SRG_PerMaterial
|
||||
float4 m_transmissionTintThickness;
|
||||
Texture2D m_transmissionThicknessMap;
|
||||
uint m_transmissionThicknessMapUvIndex;
|
||||
float m_shrinkFactor;
|
||||
|
||||
Texture2D m_wrinkle_baseColor_texture1;
|
||||
Texture2D m_wrinkle_baseColor_texture2;
|
||||
|
||||
@@ -68,7 +68,7 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI
|
||||
float E = max(0.30 + dot(-surface.normal, dirToLight), 0.0);
|
||||
|
||||
// Transmission distance computed from shadowmaps modulated by editor-exposed parameters
|
||||
float s = transmissionDistance * surface.transmission.thickness * (20 - transmissionParams.w) * 10;
|
||||
float s = transmissionDistance * surface.transmission.thickness * (50 - transmissionParams.w) * 10;
|
||||
|
||||
// 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]
|
||||
|
||||
Reference in New Issue
Block a user