|
|
|
|
|
|
|
|
|
|
// Map the roughness to the correct mip map level of the color pyramid |
|
|
|
float mipLevel = PerceptualRoughnessToMipmapLevel(bsdfData.perceptualRoughness, uint(_GaussianPyramidColorMipSize.z)); |
|
|
|
diffuseLighting = SAMPLE_TEXTURE2D_LOD(_GaussianPyramidColorTexture, sampler_GaussianPyramidColorTexture, posInput.positionSS, mipLevel).rgb; |
|
|
|
diffuseLighting = SAMPLE_TEXTURE2D_LOD(_GaussianPyramidColorTexture, sampler_GaussianPyramidColorTexture, refractedBackPointSS, mipLevel).rgb; |
|
|
|
|
|
|
|
// Beer-Lamber law for absorption |
|
|
|
float3 transmittance = exp(-bsdfData.absorptionCoefficient * opticalDepth); |
|
|
|