|
|
|
|
@ -92,7 +92,6 @@ struct VSOutput
|
|
|
|
|
float3 m_bitangent : BITANGENT;
|
|
|
|
|
float3 m_worldPosition : UV0;
|
|
|
|
|
float3 m_shadowCoords[ViewSrg::MaxCascadeCount] : UV4;
|
|
|
|
|
float3 m_shrinkedShadowCoords[ViewSrg::MaxCascadeCount] : UV9;
|
|
|
|
|
|
|
|
|
|
// Extended fields (only referenced in this azsl file)...
|
|
|
|
|
float2 m_uv[UvSetCount] : UV1;
|
|
|
|
|
@ -137,14 +136,6 @@ VSOutput SkinVS(VSInput IN)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
VertexHelper(IN, OUT, worldPosition, false);
|
|
|
|
|
|
|
|
|
|
// Fetch shadow coords for shrinked world position (used in thin transmission materials)
|
|
|
|
|
const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight;
|
|
|
|
|
DirectionalLightShadow::GetShadowCoords(
|
|
|
|
|
shadowIndex,
|
|
|
|
|
worldPosition - MaterialSrg::m_shrinkFactor * OUT.m_normal,
|
|
|
|
|
OUT.m_normal,
|
|
|
|
|
OUT.m_shrinkedShadowCoords);
|
|
|
|
|
|
|
|
|
|
return OUT;
|
|
|
|
|
}
|
|
|
|
|
@ -345,15 +336,19 @@ PbrLightingOutput SkinPS_Common(VSOutput IN)
|
|
|
|
|
|
|
|
|
|
// Directional light shadow coordinates
|
|
|
|
|
lightingData.shadowCoords = IN.m_shadowCoords;
|
|
|
|
|
lightingData.shrinkedShadowCoords = IN.m_shrinkedShadowCoords;
|
|
|
|
|
|
|
|
|
|
// Diffuse and Specular response (used in IBL calculations)
|
|
|
|
|
lightingData.specularResponse = FresnelSchlickWithRoughness(lightingData.NdotV, surface.specularF0, surface.roughnessLinear);
|
|
|
|
|
lightingData.diffuseResponse = 1.0 - lightingData.specularResponse;
|
|
|
|
|
|
|
|
|
|
// ------- Thin Object Light Transmission -------
|
|
|
|
|
|
|
|
|
|
// Angle offset for subsurface scattering through thin objects
|
|
|
|
|
lightingData.angleOffset = MaterialSrg::m_angleOffset;
|
|
|
|
|
|
|
|
|
|
// Shrink (absolute) offset towards the normal opposite direction to ensure correct shadow map projection
|
|
|
|
|
lightingData.shrinkFactor = MaterialSrg::m_shrinkFactor;
|
|
|
|
|
|
|
|
|
|
// ------- Occlusion -------
|
|
|
|
|
|
|
|
|
|
lightingData.diffuseAmbientOcclusion = GetOcclusionInput(MaterialSrg::m_diffuseOcclusionMap, MaterialSrg::m_sampler, IN.m_uv[MaterialSrg::m_diffuseOcclusionMapUvIndex], MaterialSrg::m_diffuseOcclusionFactor, o_diffuseOcclusion_useTexture);
|
|
|
|
|
|