preethams sky impementation + HDR

Initially I made this for the ocean shader planar reflections demo which is still in making.
Here is BGE version of Simon Wallner’s sky implementation originally from 2002 GDC Presentation by Naty Hoffman and Arcot J. Preetham.
I added adaptive exposure control from scene luminance.

I got the source files HERE

some screenshots with hazy skies, clear sky is boring :slight_smile:
night skies are not yet done properly

http://dl.dropbox.com/u/11542084/sky1.jpg

http://dl.dropbox.com/u/11542084/sky2.jpg

http://dl.dropbox.com/u/11542084/sky3.jpg

http://dl.dropbox.com/u/11542084/sky4.jpg

an blend here: http://dl.dropbox.com/u/11542084/preethamsky_terra.blend
not optimized much, but I am in a hurry.

controls as always:
WASD (sorry people with azerty) + mouse
LMB + mouse movement - moves the Sun
spacebar - antialiasing by laser blaster

in “lum.py”
lines 49, 50 and 51 you can play around with “g.reileigh” “g.turbidity” and “g.worldscale” values

This is absolutely incredible! Amazing work!

A Bit slow (on my Computer), but very pretty.

wow! this is the most beautiful thing I seen in the game engine. It’s amazing and runs full speed for me.

Nice job as always but imossible to use at the moment.
Many good resources Martish, too bad we cant really use them in-game.

G-GG-G-great I have no words for that, beautiful!

Looks totaly awesome, but when i start it, its there only white screen :open_mouth: please help me (i have updated my Blender to new 2.62)

edit: this new 2.62 looks little buggy :confused:

1adamm115 - b e a little patient. auto exposure has to adjust the sunlight. It takes few seconds.

Very nice indeed! Just when I thought it could not get any better…it does!!

i waited 5 minutes and more … and nothing, still white screen … i try it on 2 PCs with ATI and NVIDIA and the same problem (run on 50-60FPS) … please, what is your Blender version? thanks and sorry my VERY bad english :smiley:

I can confirm that it does not work on Blender 2.62

Is there any chance this will be indeed adoptable for in game at some point? Or is this just a proof of concept?

Either way, it does look good. Does need some tweaks, but it already does inspire a lot. :slight_smile:

I just tried this on my main Win 7 x64 box with a GTX 460 (and Blenders 2.60, 2.61 and 2.62)- the view remains white and does not fade away (probably due to the very low FPS). Look forward to optimisations (I so want to plug this into my racing game!).

If it was shader problem, then it should be all black. That means my luminance python script is not working. Here it is without HDR -
http://dl.dropbox.com/u/11542084/preethamsky_terra_noHDR.blend
rendering terrain really slow stuff down, but sky itself is fast. You can use only the skybox for the game.

Crumpet - I think it is my old sky shader they use. At least it looks like it.

Either way it looks good! :smiley:

Without HDR is working, with it its not!
Great though!

Thanks martinsh! Works flawlessly now…I fooled my wife into thinking it was a photograph!

Wow !! thats simply amazing. Absolutely great!

wow, it’s really nice to see that someone could use my code and thus save it from obscurity :smiley:

…and in such a beautiful way. That really made my day!

If you have any questions, just let me know.

best, Simon

Thanks guys for awesome replies.

hello Simon!
As I have now my own (together with mokazon) Blender development branch, I will try to get your sky implementation hardcoded in BGE, so I might have a bunch of questions :slight_smile:
I think this would be a beautiful Blender feature.

Martins