|
|
|
|
|
|
// Use overlay blend mode for detail abledo: (base < 0.5 ? (2.0 * base * blend) : (1.0 - 2.0 * (1.0 - base) * (1.0 - blend))) |
|
|
|
float3 baseColorOverlay = (detailAlbedo < 0.5) ? |
|
|
|
surfaceData.baseColor * PositivePow(2.0 * detailAlbedo, ADD_IDX(_DetailAlbedoScale)) : |
|
|
|
1.0 - 2.0 * (1.0 - surfaceData.baseColor) * (1.0 - (detailAlbedo * ADD_IDX(_DetailAlbedoScale))); |
|
|
|
1.0 - (1.0 - surfaceData.baseColor) * PositivePow(2.0 * (1.0 - detailAlbedo), ADD_IDX(_DetailAlbedoScale)); |
|
|
|
// Lerp with details mask |
|
|
|
surfaceData.baseColor = lerp(surfaceData.baseColor, saturate(baseColorOverlay), detailMask); |
|
|
|
#endif |
|
|
|
|
|
|
// Use overlay blend mode for detail abledo: (base < 0.5 ? (2.0 * base * blend) : (1.0 - 2.0 * (1.0 - base) * (1.0 - blend))) |
|
|
|
float smoothnessOverlay = (detailSmoothness < 0.5) ? |
|
|
|
surfaceData.perceptualSmoothness * PositivePow(2.0 * detailSmoothness, ADD_IDX(_DetailSmoothnessScale)) : |
|
|
|
1.0 - 2.0 * (1.0 - surfaceData.baseColor) * (1.0 - (detailSmoothness * ADD_IDX(_DetailSmoothnessScale))); |
|
|
|
1.0 - (1.0 - surfaceData.baseColor) * PositivePow(2.0 * (1.0 - detailSmoothness), ADD_IDX(_DetailSmoothnessScale)); |
|
|
|
// Lerp with details mask |
|
|
|
surfaceData.perceptualSmoothness = lerp(surfaceData.perceptualSmoothness, saturate(smoothnessOverlay), detailMask); |
|
|
|
#endif |
|
|
|