|
|
|
|
|
|
bool pixelHasTransmission = materialFeatureId == GBUFFER_LIT_TRANSMISSION_SSS || materialFeatureId == GBUFFER_LIT_TRANSMISSION; |
|
|
|
bool pixelHasAnisotropy = materialFeatureId == GBUFFER_LIT_ANISOTROPIC; |
|
|
|
bool pixelHasIridescence = materialFeatureId == GBUFFER_LIT_IRIDESCENCE; |
|
|
|
bool pixelHasClearCoat = coatMask > 0; |
|
|
|
bool pixelHasClearCoat = coatMask > 0.0; |
|
|
|
|
|
|
|
// Disable pixel features disabled by the tile. |
|
|
|
pixelFeatureFlags |= tileFeatureFlags & (pixelHasSubsurface ? MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING : 0); |
|
|
|
|
|
|
// Note: The modification of the base roughness and fresnel0 by the clear coat is already handled in FillMaterialClearCoatData |
|
|
|
|
|
|
|
// Very coarse attempt at doing energy conservation for the diffuse layer based on NdotL. No science. |
|
|
|
diffuseLighting *= lerp(1, F_Schlick(CLEAR_COAT_F0, NdotL), bsdfData.coatMask); |
|
|
|
diffuseLighting *= lerp(1, 1.0 - coatF, bsdfData.coatMask); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|