From 6e05679b3ecac8b84c6307c88c95da1a59f9f80d Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Mon, 24 Feb 2025 11:57:39 +1000 Subject: [PATCH] use exact screenspace area of AABB instead of screenspace bounding box of AABB for computing decending --- .../shaders/lod/hierarchical/screenspace.glsl | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/main/resources/assets/voxy/shaders/lod/hierarchical/screenspace.glsl b/src/main/resources/assets/voxy/shaders/lod/hierarchical/screenspace.glsl index cbada3bc..b37329a0 100644 --- a/src/main/resources/assets/voxy/shaders/lod/hierarchical/screenspace.glsl +++ b/src/main/resources/assets/voxy/shaders/lod/hierarchical/screenspace.glsl @@ -22,6 +22,9 @@ vec3 maxBB; vec2 size; float zThing; +uint BASE_IDX = gl_LocalInvocationID.x*8; +shared vec2[LOCAL_SIZE*8] screenPoints; + //Sets up screenspace with the given node id, returns true on success false on failure/should not continue //Accesses data that is setup in the main traversal and is just shared to here void setupScreenspace(in UnpackedNode node) { @@ -46,6 +49,7 @@ void setupScreenspace(in UnpackedNode node) { maxBB = minBB; zThing = -999999999999.0f; + screenPoints[BASE_IDX+0] = minBB.xy*0.5f+0.5f; for (int i = 1; i < 8; i++) { //NOTE!: cant this be precomputed and put in an array?? in the scene uniform?? vec4 pPoint = (VP*vec4(vec3((i&1)!=0,(i&2)!=0,(i&4)!=0)*(32< minSSS; + return size > minSSS; } \ No newline at end of file