Fixing pipeline cache again to fix environment mapping

This commit is contained in:
2025-07-12 16:25:49 +02:00
parent d81ea5f8e5
commit 3cc1a67664
4 changed files with 36 additions and 12 deletions
+4 -6
View File
@@ -345,11 +345,9 @@ struct CookTorrance : IBRDF
float3 k_s = F;
float3 k_d = 1 - k_s;
k_d *= 1 - metallic;
float3 diffuse = baseColor;
float3 specular = 0;
#ifdef IMAGE_BASED_LIGHTING
float3 irradiance = pLightEnv.irradianceMap.SampleLevel(pLightEnv.irradianceSampler, normal, 4).rgb;
diffuse *= irradiance;
float3 diffuse = irradiance * baseColor;
float3 r = reflect(-viewDir_WS, normal);
@@ -357,8 +355,8 @@ struct CookTorrance : IBRDF
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;
specular = prefilteredColor * (F * envBRDF.x + envBRDF.y);
#endif
float3 specular = prefilteredColor * (F * envBRDF.x + envBRDF.y);
return (k_d * diffuse + specular) * ambientOcclusion;
}
float getAlpha()