|
|
|
|
|
|
if (bsdfData.materialId == MATERIALID_LIT_CLEAR_COAT) |
|
|
|
{ |
|
|
|
ltcValue = LTCEvaluate(P1, P2, B, preLightData.ltcXformClearCoat); |
|
|
|
specularLighting += ltcValue * bsdfData.coatCoverage; |
|
|
|
// TODO: no fresnel ? |
|
|
|
specularLighting += preLightData.ltcClearCoatFresnelTerm * (ltcValue * bsdfData.coatCoverage); |
|
|
|
specularLighting += ltcValue; |
|
|
|
// TODO: no fresnel ? |
|
|
|
specularLighting += preLightData.ltcGGXFresnelTerm * ltcValue; |
|
|
|
|
|
|
|
specularLighting *= lightData.color * lightData.specularScale; |
|
|
|
} |
|
|
|
|
|
|
if (bsdfData.materialId == MATERIALID_LIT_CLEAR_COAT) |
|
|
|
{ |
|
|
|
ltcValue = LTCEvaluate(matL, V, bsdfData.coatNormalWS, preLightData.coatNdotV, preLightData.ltcXformClearCoat); |
|
|
|
specularLighting += preLightData.ltcClearCoatFresnelTerm * ltcValue * bsdfData.coatCoverage; |
|
|
|
specularLighting += preLightData.ltcClearCoatFresnelTerm * (ltcValue * bsdfData.coatCoverage); |
|
|
|
|
|
|
|
// modify matL value based on Fresnel transmission |
|
|
|
matL = mul(matL, preLightData.ltcCoatT); |
|
|
|