Atmospheric Scattering

Hello, I havent posted anything for too long time :). So, here I present you a shader ive recently been busy with.

It is based on the chapter “Accurate Atmospheric Scattering” of the “GPU Gems 2” I found here:

Scene contains 4 spheres: 2 for ground & 2 for atmosphere, as there are 4 shaders (Ground from Space/Atmopshere & Skies from Space/Atmosphere).

Feel free to use this in your own projects, but the setup may be a headache.
Moving, scaling etc. operations of the spheres will cause strangeness :slight_smile:

Yet to do:

• easier setup
• skydome only (if you dont need a view from space)

• cloud coverage
• normal-mapped lighting for ground
• ocean material


panoramic 360° views of setting Sun (thanks to dfelinto`s Dome rendering):

a view from ground:


and a blend :

wasd - move camera
mouse movement - mouselook
left mouse button&mouse movement - grab&move sun
mousewheel up/down - scattering exposure
Up/Down - scattering samples


That is really cool!!!

And very realistic.

Thanks for sharing!

you are crazy, very crazy …:spin:
congratulations you deserve!

thanks for sharing:D

Fantastic martinsh!
As always… xD
Thanks Martinsh you´re the Master of BGE Graphics!

Congratulations mate, you did it! I looks great, that’s what I’ve been looking for!

5* as allways
very nice and realistic…
many thanks for sharing

wondering what would be next :slight_smile:

wow … damn usefull and elegant … thanks for sharing !

… wow …
I was impressed at the screen shots when I thought it was a rendered effect. I nearly had an accident when I realized it was real-time!

Absolutely beautiful.

wooot I just watched those procedural clouds video on youtube… pure awesomness
can’t believe my eyes

Wow this is incredible. And runs quite well. Most things like this hardly run on my comp, but this runs at 15 fps. Doesn’t sound like much, but its great for me.

you are freaking awersome!

Thank you :smiley:

here are a video:
(YouTube and Vimeo versions)

A couple of general questions…

Are these videos being made with screen capture?

Is there a way to use game engine / GLSL shaders directly in still/video renders?

Yeah Fraps at 30 frames per second.

Yup, but the captured image size is limited by your monitor size.

Wow, you really deserve the title “BGE God”, martinsh. Awesome as always!

Would that method be to use FRAPS to capture OpenGL directly? Not a conventional F12 Blender Internal render?

Fraps or any other screen capturing software, yeah.
Though there is a way to to render images of each frame to specified folder. The python code were quite simple as I remember.

Awesome, thanks to suply us, your work on this filters are are, are i dont know, it saves my life every day, i use your filters on my job, they are excelent. Thanks, realy thanks for this

Daaaammmm, thats awesome.