Need help with BGE 2D light scatter/volumetric light script!

So, I have a really nice demo set up, and I have bloom and chromatic abberation 2D filters, and now I want a dynamic volumetric light script. So I found a cheep and working volumetric light script (which is used as a 2D filter), but the problem is, it only works on the sky. I’m pretty bad at coding shaders, and I’d like some help!

I want something like my bloom shader:
***uniform sampler2D bgl_RenderedTexture;

const float BRIGHT_PASS_THRESHOLD = 0.5;
const float BRIGHT_PASS_OFFSET = 0.3;

#define blurclamp 0.003
#define bias 0.01

#define KERNEL_SIZE 5.0

vec2 texcoord = vec2(gl_TexCoord[0]).st;

vec4 bright(vec2 coo)
{
vec4 color = texture2D(bgl_RenderedTexture, coo);

color = max(color - BRIGHT_PASS_THRESHOLD, 0.0);

return color / (color + BRIGHT_PASS_OFFSET);
}

void main(void)
{
vec2 blur = vec2(clamp( bias, -blurclamp, blurclamp ));

vec4 col = vec4( 0, 0, 0, 0 );
for ( float x = -KERNEL_SIZE + 1.0; x < KERNEL_SIZE; x += 1.0 )
{
for ( float y = -KERNEL_SIZE + 1.0; y < KERNEL_SIZE; y += 1.0 )
{
col += bright( texcoord + vec2( blur.x * x, blur.y * y ) );
}
}
col /= ((KERNEL_SIZE+KERNEL_SIZE)-1.0)*((KERNEL_SIZE+KERNEL_SIZE)-1.0);
gl_FragColor = col + texture2D(bgl_RenderedTexture, texcoord);
}
***I found the shader on this website, and it’s really nice because it detects any color on the screen that is bright enough to have the bloom affect applied. And with the light scatter shader, it seems to only work on the sky:
***uniform sampler2D bgl_RenderedTexture;
uniform sampler2D bgl_DepthTexture;

//uniform float avgL;

const float dens = 0.5; // Density
const float dec = 0.88; // Decay
const float weight = 0.2;
float exp = 0.1; // Exposure

// Light Screen (Origin if effect is not working Play with X & Y)

uniform float xPos = 0.5; // 0.0 - 1.0
uniform float yPos = 0.8; // 0.0 - 1.0

uniform vec2 lightScreenPos;

// Number of Ray Samples (Quality 1 - 128)

const int raySamples = 64;

void main()
{

vec4 origin = vec4(0);
vec4 sample = vec4(0);
vec4 mask = vec4(0);


vec2 lightScreenPos = vec2(xPos,yPos);


vec2 deltaTexCoord = vec2(gl_TexCoord[3]) - lightScreenPos;
vec2 texCoo = gl_TexCoord[0].st;
deltaTexCoord *= 1.0 / float(raySamples) * dens;
float illumDecay = 1.0;

for(int i=0; i < raySamples ; i++)
{
texCoo -= deltaTexCoord;

    if (texture2D(bgl_DepthTexture, texCoo).r &gt; 0.9989)
    {
        sample += texture2D(bgl_RenderedTexture, texCoo);
    }
    
    sample *= illumDecay * weight;

    origin += sample;
    illumDecay *= dec;
}

vec2 texcoord = vec2(gl_TexCoord[0]);

gl_FragColor = texture2D(bgl_RenderedTexture, texcoord) + (origin*exp);

}

You should put code in a code tags.
you might need to do some work on normalizing the depth texture. Try changing the clipping values on you camera see if it gives a better result.