Original Post
Hiya. Recently, I was told that I should use GLSL to create fog in my game, because I was having a lot of blending issues. This was basically about capturing the depth buffer to a texture, and using it to calculate fog in a GLSL shader. I was wondering, does anyone have an example of this kind of shader? To be honest I'm a complete newbie with GLSL, and I have no idea how I should do this kind of thing. As far as I understand, I have to capture the screen rectangle texture, the depth buffer into a texture, and pass these down, together with my fog settings to the shader, and let it work on the texture, and then I just render a quad over the screen? I'd be really happy if I could get some guidance, because I'm kinda lost. Thanks. Andrew.