|
|
|
|
|
|
// Subsurface scattering mode |
|
|
|
float3 modifiedDiffuseColor = GetModifiedDiffuseColorForSSS(bsdfData); |
|
|
|
|
|
|
|
// Apply volume indirect multipler |
|
|
|
builtinData.bakeDiffuseLighting *= _IndirectLightingMultiplier.x; |
|
|
|
lighting.indirect.specularReflected *= _IndirectLightingMultiplier.y; |
|
|
|
|
|
|
|
diffuseLighting = modifiedDiffuseColor * lighting.direct.diffuse + builtinData.bakeDiffuseLighting * _IndirectLightingMultiplier.x; |
|
|
|
diffuseLighting = modifiedDiffuseColor * lighting.direct.diffuse + builtinData.bakeDiffuseLighting; |
|
|
|
|
|
|
|
// If refraction is enable we use the transmittanceMask to lerp between current diffuse lighting and refraction value |
|
|
|
// Physically speaking, transmittanceMask should be 1, but for artistic reasons, we let the value vary |
|
|
|
|
|
|
|
|
|
|
specularLighting = lighting.direct.specular + lighting.indirect.specularReflected * _IndirectLightingMultiplier.y; |
|
|
|
specularLighting = lighting.direct.specular + lighting.indirect.specularReflected; |
|
|
|
// Rescale the GGX to account for the multiple scattering. |
|
|
|
specularLighting *= 1.0 + bsdfData.fresnel0 * preLightData.energyCompensation; |
|
|
|
|
|
|
|