Browse Source

API changed to accomodate normal offset bias shadowmapping and this .azsl file needs to change (#235)

* the API changed for this, updating

Signed-off-by: mrieggeramzn <[email protected]>

* Setting vertex normal

Signed-off-by: mrieggeramzn <[email protected]>
mrieggeramzn 3 years ago
parent
commit
ccb7f78231
2 changed files with 2 additions and 1 deletions
  1. 1 1
      Materials/DynamicMaterialTest/EmissiveMaterial.azsl
  2. 1 0
      Shaders/StaticMesh.azsl

+ 1 - 1
Materials/DynamicMaterialTest/EmissiveMaterial.azsl

@@ -72,7 +72,7 @@ ForwardPassOutput MainPS(VSOutput IN)
     
     
     // Position, Normal, Roughness
     // Position, Normal, Roughness
     surface.position = IN.m_worldPosition.xyz;
     surface.position = IN.m_worldPosition.xyz;
-    surface.normal = normalize(IN.m_normal);
+    surface.normal = surface.vertexNormal = normalize(IN.m_normal);
     surface.roughnessLinear = 1.0f;
     surface.roughnessLinear = 1.0f;
     surface.CalculateRoughnessA();
     surface.CalculateRoughnessA();
 
 

+ 1 - 0
Shaders/StaticMesh.azsl

@@ -70,6 +70,7 @@ VertexOutput MainVS(VertexInput input)
         DirectionalLightShadow::GetShadowCoords(
         DirectionalLightShadow::GetShadowCoords(
             lightIndex,
             lightIndex,
             worldPosition,
             worldPosition,
+            output.m_normal,
             output.m_shadowCoords);
             output.m_shadowCoords);
     }
     }