More lighting changes

This commit is contained in:
Dynamitos
2025-03-13 08:23:00 +01:00
parent 80f86ca95c
commit 51d759639e
11 changed files with 18 additions and 20 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ struct DirectionalLight : ILightEnv
float3 illuminate<B:IBRDF>(LightingParameter params, B brdf)
{
float3 dir_WS = -normalize(direction.xyz);
return brdf.evaluate(params.viewDir_WS, dir_WS, color.xyz);
return brdf.evaluate(params.viewDir_WS, dir_WS, color.xyz * color.w);
}
};
@@ -29,7 +29,7 @@ struct PointLight : ILightEnv
float3 lightDir_WS = position_WS.xyz - params.position_WS;
float d = length(lightDir_WS);
float illuminance = max(1 - d / colorRange.w, 0);
return illuminance * brdf.evaluate(params.viewDir_WS, normalize(lightDir_WS), colorRange.xyz);
return illuminance * brdf.evaluate(params.viewDir_WS, normalize(lightDir_WS), colorRange.xyz * position_WS.w);
}
bool insidePlane(Plane plane, float3 position)