Fixed lighting

This commit is contained in:
Dynamitos committed 2024-02-20 22:38:35 +01:00
1 parent 2480529dbc
commit 99ee991bf5
3 files changed
+12 -8

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ struct PointLight : ILightEnv
float3 illuminate<B:IBRDF>(LightingParameter params, B brdf)
{
float3 lightDir_WS = position_WS.xyz - params.position_WS;
float3 lightDir_WS = params.position_WS - position_WS.xyz;
float3 lightDir_TS = mul(params.tbn, lightDir_WS);
float d = length(lightDir_TS);
float illuminance = max(1 - d / colorRange.w, 0);