Fixing basepass light culling data

This commit is contained in:
Dynamitos
2024-02-21 10:30:04 +01:00
parent 99ee991bf5
commit 15813ba612
9 changed files with 43 additions and 54 deletions
+2 -5
View File
@@ -12,15 +12,12 @@ struct ViewParameter
layout(set = 0)
ParameterBlock<ViewParameter> pViewParams;
// Convert screen space coordinates to view space.
float4 screenToClip( float4 screen )
float3 screenToClip(float3 screen)
{
// Convert to normalized texture coordinates
float2 texCoord = screen.xy / pViewParams.screenDimensions;
// Convert to clip space
return float4( float2( texCoord.x, 1.0f-texCoord.y ) * 2.0f - 1.0f, screen.z, screen.w );
return float3( float2( texCoord.x, 1.0f-texCoord.y ) * 2.0f - 1.0f, screen.z);
}
struct Plane
+1 -1
View File
@@ -30,7 +30,7 @@ struct PointLight : ILightEnv
float3 lightDir_TS = mul(params.tbn, lightDir_WS);
float d = length(lightDir_TS);
float illuminance = max(1 - d / colorRange.w, 0);
return illuminance * brdf.evaluate(params.tbn, params.viewDir_TS, normalize(lightDir_TS), colorRange.xyz);
return illuminance * brdf.evaluate(params.tbn, params.viewDir_TS, -normalize(lightDir_TS), colorRange.xyz);
}
float3 getClipPosition()
{