Define background depth threshold constant for god rays

This commit is contained in:
2026-04-30 01:02:45 +02:00
parent 7919c59fd1
commit 3f2fc65eca

View File

@@ -375,6 +375,8 @@ uniform int sampleCount;
varying vec2 vUv; varying vec2 vUv;
const float BACKGROUND_DEPTH_THRESHOLD = 0.9999999;
float readDepth(const in vec2 uv) { float readDepth(const in vec2 uv) {
#if DEPTH_PACKING == 3201 #if DEPTH_PACKING == 3201
return unpackRGBAToDepth(texture2D(depthBuffer, uv)); return unpackRGBAToDepth(texture2D(depthBuffer, uv));
@@ -396,7 +398,7 @@ float getAtmosphereMask(const in float depth) {
return 1.0; return 1.0;
} }
if (depth >= 0.9999) { if (depth >= BACKGROUND_DEPTH_THRESHOLD) {
return 1.0; return 1.0;
} }