|
|
|
|
|
|
float3 normalTS; |
|
|
|
float alpha = GetSurfaceData(input, layerTexCoord, surfaceData, normalTS); |
|
|
|
GetNormalAndTangentWS(input, V, normalTS, surfaceData.normalWS, surfaceData.tangentWS); |
|
|
|
// Done one time for all layered - cumulate with spec occ alpha for now |
|
|
|
surfaceData.specularOcclusion *= GetHorizonOcclusion(V, surfaceData.normalWS, input.tangentToWorld[2].xyz, _HorizonFade); |
|
|
|
|
|
|
|
// Caution: surfaceData must be fully initialize before calling GetBuiltinData |
|
|
|
GetBuiltinData(input, surfaceData, alpha, depthOffset, builtinData); |
|
|
|
|
|
|
float3 normalTS = BlendLayeredVector3(normalTS0, normalTS1, normalTS2, normalTS3, weights); |
|
|
|
#endif |
|
|
|
|
|
|
|
surfaceData.specularOcclusion = SURFACEDATA_BLEND_SCALAR(surfaceData, specularOcclusion, weights); |
|
|
|
surfaceData.perceptualSmoothness = SURFACEDATA_BLEND_SCALAR(surfaceData, perceptualSmoothness, weights); |
|
|
|
surfaceData.ambientOcclusion = SURFACEDATA_BLEND_SCALAR(surfaceData, ambientOcclusion, weights); |
|
|
|
surfaceData.metallic = SURFACEDATA_BLEND_SCALAR(surfaceData, metallic, weights); |
|
|
|
|
|
|
surfaceData.specularColor = float3(0.0, 0.0, 0.0); |
|
|
|
|
|
|
|
GetNormalAndTangentWS(input, V, normalTS, surfaceData.normalWS, surfaceData.tangentWS); |
|
|
|
// Done one time for all layered - cumulate with spec occ alpha for now |
|
|
|
surfaceData.specularOcclusion = SURFACEDATA_BLEND_SCALAR(surfaceData, specularOcclusion, weights); |
|
|
|
surfaceData.specularOcclusion *= GetHorizonOcclusion(V, surfaceData.normalWS, input.tangentToWorld[2].xyz, _HorizonFade); |
|
|
|
|
|
|
|
GetBuiltinData(input, surfaceData, alpha, depthOffset, builtinData); |
|
|
|
} |
|
|
|