Skip to content

Commit d55ef69

Browse files
committed
Increase ranges of SSS parameters
1 parent f0ce20d commit d55ef69

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ BSDFData ConvertSurfaceDataToBSDFData(SurfaceData surfaceData)
175175
bsdfData.fresnel0 = 0.04; /* 0.028 ? */
176176
bsdfData.subsurfaceProfile = surfaceData.subsurfaceProfile;
177177
// Make the Std. Dev. of 1 correspond to the effective radius of 1 cm (three-sigma rule).
178-
bsdfData.subsurfaceRadius = SSS_UNIT_CONVERSION * surfaceData.subsurfaceRadius;
178+
bsdfData.subsurfaceRadius = SSS_UNIT_CONVERSION * surfaceData.subsurfaceRadius + 0.0001;
179179
bsdfData.thickness = SSS_UNIT_CONVERSION * (_ThicknessRemaps[bsdfData.subsurfaceProfile][0] +
180180
_ThicknessRemaps[bsdfData.subsurfaceProfile][1] * surfaceData.thickness);
181181
bsdfData.enableTransmission = IsBitSet(_TransmissionFlags, bsdfData.subsurfaceProfile);
@@ -395,7 +395,7 @@ void DecodeFromGBuffer(
395395
bsdfData.fresnel0 = 0.04; /* 0.028 ? */
396396
bsdfData.subsurfaceProfile = (SSS_N_PROFILES - 1) * inGBuffer2.a;
397397
// Make the Std. Dev. of 1 correspond to the effective radius of 1 cm (three-sigma rule).
398-
bsdfData.subsurfaceRadius = SSS_UNIT_CONVERSION * inGBuffer2.r;
398+
bsdfData.subsurfaceRadius = SSS_UNIT_CONVERSION * inGBuffer2.r + 0.0001;
399399
bsdfData.thickness = SSS_UNIT_CONVERSION * (_ThicknessRemaps[bsdfData.subsurfaceProfile][0] +
400400
_ThicknessRemaps[bsdfData.subsurfaceProfile][1] * inGBuffer2.g);
401401
bsdfData.enableTransmission = IsBitSet(_TransmissionFlags, bsdfData.subsurfaceProfile);

Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ Shader "HDRenderPipeline/Lit"
3333
_AnisotropyMap("AnisotropyMap", 2D) = "white" {}
3434

3535
_SubsurfaceProfile("Subsurface Profile", Int) = 0
36-
_SubsurfaceRadius("Subsurface Radius", Range(0.004, 1.0)) = 1.0
36+
_SubsurfaceRadius("Subsurface Radius", Range(0.0, 1.0)) = 1.0
3737
_SubsurfaceRadiusMap("Subsurface Radius Map", 2D) = "white" {}
38-
_Thickness("Thickness", Range(0.004, 1.0)) = 1.0
38+
_Thickness("Thickness", Range(0.0, 1.0)) = 1.0
3939
_ThicknessMap("Thickness Map", 2D) = "white" {}
4040

4141
// Wind

Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ Shader "HDRenderPipeline/LitTessellation"
3333
_AnisotropyMap("AnisotropyMap", 2D) = "white" {}
3434

3535
_SubsurfaceProfile("Subsurface Profile", Int) = 0
36-
_SubsurfaceRadius("Subsurface Radius", Range(0.004, 1.0)) = 1.0
36+
_SubsurfaceRadius("Subsurface Radius", Range(0.0, 1.0)) = 1.0
3737
_SubsurfaceRadiusMap("Subsurface Radius Map", 2D) = "white" {}
38-
_Thickness("Thickness", Range(0.004, 1.0)) = 1.0
38+
_Thickness("Thickness", Range(0.0, 1.0)) = 1.0
3939
_ThicknessMap("Thickness Map", 2D) = "white" {}
4040

4141
// Wind

Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/SubsurfaceScatteringProfile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ public override void OnInspectorGUI()
463463
Vector2 thicknessRemap = m_ThicknessRemap.vector2Value;
464464
EditorGUILayout.LabelField("Min thickness: ", thicknessRemap.x.ToString());
465465
EditorGUILayout.LabelField("Max thickness: ", thicknessRemap.y.ToString());
466-
EditorGUILayout.MinMaxSlider(styles.sssProfileThicknessRemap, ref thicknessRemap.x, ref thicknessRemap.y, 0, 10);
466+
EditorGUILayout.MinMaxSlider(styles.sssProfileThicknessRemap, ref thicknessRemap.x, ref thicknessRemap.y, 0, 1000);
467467
m_ThicknessRemap.vector2Value = thicknessRemap;
468468

469469
EditorGUILayout.Space();

0 commit comments

Comments
 (0)