forked from Dynamitos/Seele
Fix miscellaneus errors
This commit is contained in:
1 parent
c5c66f8cf3
commit
803531c608
17 files changed
+146
-88
No files matched your search
@@ -359,7 +359,9 @@ struct CookTorrance : IBRDF
|
||||
const float MAX_REFLECTION_LOD = 4;
|
||||
float3 prefilteredColor = pLightEnv.prefilteredMap.SampleLevel(pLightEnv.irradianceSampler, r, roughness * MAX_REFLECTION_LOD).xyz;
|
||||
|
||||
float2 envBRDF = pLightEnv.brdfLUT.Sample(pLightEnv.lutSampler, float2(max(dot(normal, viewDir_WS), 0), roughness)).rg;
|
||||
// brdfLUT has no mip levels and is indexed analytically (N·V, roughness) with no screen
|
||||
// derivatives, so implicit LOD is unavailable (GLCompute/Ray) and meaningless: use level 0.
|
||||
float2 envBRDF = pLightEnv.brdfLUT.SampleLevel(pLightEnv.lutSampler, float2(max(dot(normal, viewDir_WS), 0), roughness), 0).rg;
|
||||
float3 specular = prefilteredColor * (F * envBRDF.x + envBRDF.y);
|
||||
|
||||
return (k_d * diffuse + specular) * ambientOcclusion;
|
||||
|
||||
Reference in new issue
Block a user