From 3f2fc65eca798627c56639b0c6d452e49b881612 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Thu, 30 Apr 2026 01:02:45 +0200 Subject: [PATCH] Define background depth threshold constant for god rays --- src/rendering/screen-space-god-rays.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rendering/screen-space-god-rays.ts b/src/rendering/screen-space-god-rays.ts index 32ff5be0..a648c777 100644 --- a/src/rendering/screen-space-god-rays.ts +++ b/src/rendering/screen-space-god-rays.ts @@ -375,6 +375,8 @@ uniform int sampleCount; varying vec2 vUv; +const float BACKGROUND_DEPTH_THRESHOLD = 0.9999999; + float readDepth(const in vec2 uv) { #if DEPTH_PACKING == 3201 return unpackRGBAToDepth(texture2D(depthBuffer, uv)); @@ -396,7 +398,7 @@ float getAtmosphereMask(const in float depth) { return 1.0; } - if (depth >= 0.9999) { + if (depth >= BACKGROUND_DEPTH_THRESHOLD) { return 1.0; }