|
|
|
|
|
|
|
|
|
|
if (NdotL > 0.0) |
|
|
|
{ |
|
|
|
float sampleWeight = 1; |
|
|
|
float4 val = SampleEnv(lightLoopContext, lightData.envIndex, L, 0, sampleWeight); |
|
|
|
float4 val = SampleEnv(lightLoopContext, lightData.envIndex, L, 0); |
|
|
|
|
|
|
|
// We don't multiply by 'bsdfData.diffuseColor' here. It's done only once in PostEvaluateBSDF(). |
|
|
|
acc += LambertNoPI() * weightOverPdf * val.rgb; |
|
|
|
|
|
|
// in weightOverPdf of ImportanceSampleLambert call. |
|
|
|
float disneyDiffuse = DisneyDiffuse(NdotV, NdotL, LdotV, bsdfData.perceptualRoughness); |
|
|
|
|
|
|
|
float sampleWeight = 1; |
|
|
|
float4 val = SampleEnv(lightLoopContext, lightData.envIndex, L, 0, sampleWeight); |
|
|
|
float4 val = SampleEnv(lightLoopContext, lightData.envIndex, L, 0); |
|
|
|
// We don't multiply by 'bsdfData.diffuseColor' here. It's done only once in PostEvaluateBSDF(). |
|
|
|
acc += disneyDiffuse * weightOverPdf * val.rgb; |
|
|
|
} |
|
|
|
|
|
|
// Fresnel component is apply here as describe in ImportanceSampleGGX function |
|
|
|
float3 FweightOverPdf = F_Schlick(bsdfData.fresnel0, VdotH) * weightOverPdf; |
|
|
|
|
|
|
|
float sampleWeight = 1; |
|
|
|
float4 val = SampleEnv(lightLoopContext, lightData.envIndex, L, 0, sampleWeight); |
|
|
|
float4 val = SampleEnv(lightLoopContext, lightData.envIndex, L, 0); |
|
|
|
|
|
|
|
acc += FweightOverPdf * val.rgb; |
|
|
|
} |
|
|
|