|
|
|
|
|
|
#ifdef LIT_DIFFUSE_LAMBERT_BRDF |
|
|
|
diffuseFGD = 1.0; |
|
|
|
#else |
|
|
|
// Remap from [0, 1] to [0, 1.5] range. |
|
|
|
diffuseFGD = 1.5 * preFGD.z; |
|
|
|
// Remap from the [0, 1] to the [0.5, 1.5] range. |
|
|
|
diffuseFGD = preFGD.z + 0.5; |
|
|
|
#endif |
|
|
|
|
|
|
|
reflectivity = preFGD.y; |
|
|
|
|
|
|
// envDiffuseLighting is used for refraction in this Lit material. Use the weight to balance between transmission and reflection |
|
|
|
diffuseLighting = lerp(directDiffuseLighting + bakeDiffuseLighting, accLighting.envDiffuseLighting, accLighting.envDiffuseLightingWeight); |
|
|
|
specularLighting = accLighting.dirSpecularLighting + accLighting.punctualSpecularLighting + accLighting.areaSpecularLighting + accLighting.envSpecularLighting; |
|
|
|
// Rescale the GGX to account for the multiple scattering. |
|
|
|
specularLighting *= 1 + bsdfData.fresnel0 * preLightData.energyCompensation; |
|
|
|
} |
|
|
|
|