From 1794b1ac4b16760a348a60eb23099170c7f38946 Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Sat, 19 Apr 2025 16:34:19 +1000 Subject: [PATCH] Tweeks to frustum issues with how did things --- .../shaders/lod/hierarchical/screenspace.glsl | 39 ++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) 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 9a49a5a1..d80b002b 100644 --- a/src/main/resources/assets/voxy/shaders/lod/hierarchical/screenspace.glsl +++ b/src/main/resources/assets/voxy/shaders/lod/hierarchical/screenspace.glsl @@ -20,10 +20,23 @@ layout(binding = HIZ_BINDING) uniform sampler2DShadow hizDepthSampler; vec3 minBB; vec3 maxBB; vec2 size; +bool insideFrustum; uint BASE_IDX = gl_LocalInvocationID.x*8; shared vec2[LOCAL_SIZE*8] screenPoints; +bool within(vec2 a, vec2 b, vec2 c) { + return all(lessThan(a,b)) && all(lessThan(b, c)); +} + +bool within(vec3 a, vec3 b, vec3 c) { + return all(lessThan(a,b)) && all(lessThan(b, c)); +} + +bool within(float a, float b, float c) { + return a 1 is actually wrong + return !insideFrustum;// maxW < 16 is a trick where 16 is the near plane //|| any(lessThanEqual(minBB, vec3(0.0f, 0.0f, 0.0f))) || any(lessThanEqual(vec3(1.0f, 1.0f, 1.0f), maxBB)); }