preethams sky impementation + HDR


(martinsh) #1

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


(MrPutuLips) #2

This is absolutely incredible! Amazing work!


(C.A.ligári) #3

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


(Chishado) #4

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


(JohnnyBlack) #5

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


(leonnn) #6

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


(1adamm115) #7

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:


(martinsh) #8

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


(Rubbernuke) #9

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


(1adamm115) #10

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:


(dodosoft) #11

I can confirm that it does not work on Blender 2.62


(Crumpet) #12

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:


(Rubbernuke) #13

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!).


(martinsh) #14

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.


(Crumpet) #15

Either way it looks good! :smiley:


(JohnnyBlack) #16

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


(Rubbernuke) #17

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


(sevi) #18

Wow !! thats simply amazing. Absolutely great!


(SimonW) #19

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


(martinsh) #20

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