Fixed lighting

This commit is contained in:
Dynamitos
2024-02-20 22:38:35 +01:00
parent 2480529dbc
commit 99ee991bf5
3 changed files with 12 additions and 8 deletions
+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);