Skip to content

Commit 36184e4

Browse files
- Fixed Smoothness maps on Lit/LayeredLit shaders
- Reduced default heightmap scale to 0.01 for Lit/LayeredLit shaders.
1 parent 775617b commit 36184e4

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.shader

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Shader "HDRenderLoop/Lit"
1818
_NormalMap("NormalMap", 2D) = "bump" {}
1919

2020
_HeightMap("HeightMap", 2D) = "black" {}
21-
_HeightScale("Height Scale", Float) = 1
21+
_HeightScale("Height Scale", Float) = 0.01
2222
_HeightBias("Height Bias", Float) = 0
2323

2424
_TangentMap("TangentMap", 2D) = "bump" {}
@@ -29,7 +29,7 @@ Shader "HDRenderLoop/Lit"
2929
_DetailMask("DetailMask", 2D) = "white" {}
3030
_DetailAlbedoScale("_DetailAlbedoScale", Range(-2.0, 2.0)) = 1
3131
_DetailNormalScale("_DetailNormalScale", Range(0.0, 2.0)) = 1
32-
_DetailSmoothnessScale("_DetailSmoothnessScale", Range(-2.0, 2.0)) = 1
32+
_DetailSmoothnessScale("_DetailSmoothnessScale", Range(-2.0, 2.0)) = 0.01
3333
_DetailHeightScale("_DetailHeightScale", Range(-2.0, 2.0)) = 1
3434
_DetailAOScale("_DetailAOScale", Range(-2.0, 2.0)) = 1
3535

Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/LitSurfaceData.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ float ADD_IDX(GetSurfaceData)(FragInput input, LayerTexCoord layerTexCoord, out
156156
#else
157157
surfaceData.perceptualSmoothness = 1.0;
158158
#endif
159-
surfaceData.perceptualSmoothness = ADD_IDX(_Smoothness);
159+
surfaceData.perceptualSmoothness *= ADD_IDX(_Smoothness);
160160
#ifdef _DETAIL_MAP
161161
surfaceData.perceptualSmoothness *= LerpWhiteTo(2.0 * saturate(detailSmoothness * ADD_IDX(_DetailSmoothnessScale)), detailMask);
162162
#endif

Assets/TestScenes/HDTest/GlobalIlluminationTest.unity

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ RenderSettings:
3737
m_ReflectionIntensity: 1
3838
m_CustomReflection: {fileID: 0}
3939
m_Sun: {fileID: 0}
40-
m_IndirectSpecularColor: {r: 0.5456174, g: 0.39782104, b: 0.24038851, a: 1}
40+
m_IndirectSpecularColor: {r: 0.6238628, g: 0.56322443, b: 0.5425187, a: 1}
4141
--- !u!157 &3
4242
LightmapSettings:
4343
m_ObjectHideFlags: 0
@@ -454,6 +454,7 @@ GameObject:
454454
m_Component:
455455
- component: {fileID: 565152815}
456456
- component: {fileID: 565152816}
457+
- component: {fileID: 565152817}
457458
m_Layer: 0
458459
m_Name: Spotlight
459460
m_TagString: Untagged
@@ -508,6 +509,25 @@ Light:
508509
m_BounceIntensity: 1
509510
m_ShadowRadius: 0
510511
m_ShadowAngle: 0
512+
--- !u!114 &565152817
513+
MonoBehaviour:
514+
m_ObjectHideFlags: 0
515+
m_PrefabParentObject: {fileID: 0}
516+
m_PrefabInternal: {fileID: 0}
517+
m_GameObject: {fileID: 565152814}
518+
m_Enabled: 1
519+
m_EditorHideFlags: 0
520+
m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3}
521+
m_Name:
522+
m_EditorClassIdentifier:
523+
shadowResolution: 512
524+
shadowDimmer: 1
525+
affectDiffuse: 1
526+
affectSpecular: 1
527+
archetype: 0
528+
isDoubleSided: 0
529+
areaLightLength: 0
530+
areaLightWidth: 0
511531
--- !u!1 &841702834
512532
GameObject:
513533
m_ObjectHideFlags: 0
@@ -963,7 +983,7 @@ MonoBehaviour:
963983
shadowDimmer: 1
964984
affectDiffuse: 1
965985
affectSpecular: 1
966-
treatAsAreaLight: 0
986+
archetype: 0
967987
isDoubleSided: 0
968988
areaLightLength: 0
969989
areaLightWidth: 0
@@ -1379,7 +1399,7 @@ Transform:
13791399
m_PrefabInternal: {fileID: 0}
13801400
m_GameObject: {fileID: 1543726725}
13811401
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
1382-
m_LocalPosition: {x: -6.33, y: 0.428, z: -5.0499997}
1402+
m_LocalPosition: {x: -6.33, y: 0.428, z: -4.84}
13831403
m_LocalScale: {x: 1.6119599, y: 1.6119599, z: 1.6119599}
13841404
m_Children: []
13851405
m_Father: {fileID: 1027688891}

0 commit comments

Comments
 (0)