Volumetric GLSL Fog Blast from the past

Hey all,

So I was playing around with some texture nodes and had some interesting results with self made toon shading (1st attachment), since I think the bge can maybe score with a more stylized approach to graphics. The thing I made maps a picture to a certain shadow level, so you can hand draw the shadow level you want and the rendering engine will make that match. I only used a UV grid but I think the idea becomes clear. It’s pretty simple and not exactly special, but if there is demand I can upload the blend or a screenshot of the nodelayout.

Anyway, something else I kind of want is fog. Because low poly, badly textured or colored and badly modeled stuff like I suspect my stuff will be compared to professional assets, seems waaay cooler when everything is kind of dark and foggy.

So I looked around a bit and found that there actually is a way to draw fog with GLSL and someone already did it. Back in 2008. Yup.

blenderartists.org/forum/showthread.php?t=152343

Unfortunately all download links are down, maybe some of you veterans downloaded the file back then and can reupload it now? I did tinker around with GLSL a bit, but it’s tricky, so I’d rather not have to manually replicate the result from the post above.

:slight_smile: thanks for reading :slight_smile:

Attachments


do you mean glsl code? fog/mist is super easy with nodes, if the world settings arent enough.


Oh, yeah, should have mentioned, I don’t want something based on view distance, I want the input variable to be the distance the ray travels inside the fog object.

I found this lecture on graphics programming and the demo they use:

https://www.evl.uic.edu/sjames/cs525/shader.html

http://www.humus.name/index.php?page=3D&ID=70

But that’s mixing c++ and openGL and it’s also view distance based.

So ideally like that, but in way that the fog is limited to the volume of an object.