Skip to content

Commit

Permalink
tweak fsl compiler error
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Pollind <[email protected]>
  • Loading branch information
pollend committed Nov 4, 2023
1 parent d3002eb commit 4699140
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions HPL2/resource/point_light_clusters.comp.fsl
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#include "light_cull_resources.h.fsl"


NUM_THREADS(LIGHT_CLUSTER_WIDTH, LIGHT_CLUSTER_HEIGHT, 1)
void CS_MAIN(SV_GroupThreadID(uint3) threadInGroupId, SV_GroupID(uint3) groupId)
{
INIT_MAIN;
const float invClusterWidth = 1.0f / float(LIGHT_CLUSTER_WIDTH);
const float invClusterHeight = 1.0f / float(LIGHT_CLUSTER_HEIGHT);
const float2 windowSize = Get(windowSize);
const float2 size = Get(windowSize);

const float aspectRatio = windowSize.x / windowSize.y;
const float aspectRatio = size.x / size.y;

PointLight lightData = Get(pointLights)[groupId.x];

Expand All @@ -20,7 +19,7 @@ void CS_MAIN(SV_GroupThreadID(uint3) threadInGroupId, SV_GroupID(uint3) groupId)

float fov = 2.0 * atan(1.0/Get(projMat)[1][1]);
float projRadius = 2.0f * lightData.lightRadius * (1 / tan(fov * 0.5f)) * invLightPosW;
projRadius *= windowSize.x > windowSize.y ? aspectRatio : 1 / aspectRatio;
projRadius *= size.x > size.y ? aspectRatio : 1 / aspectRatio;

// Early exit light if it's behind the camera
if (lightPosClipSpace.w < 0.0f && -lightPosClipSpace.w > lightData.lightRadius) {
Expand Down

0 comments on commit 4699140

Please sign in to comment.