SkyDome with dynamics skylight

Hi all,

I am newbie in the 3D world programming and i have been worked on Skydome with dynamics skylight (“A practical Analytic Model for Daylight” by A. J. Preetham, Peter Shirley, Brian Smits (University of Utah).

I added a new topic on Wiki page:

I dont know if it is usefull for anybody, neither if it is very GPU’s expensive, but, i would appreciate that somebody

checks the code and suggests optimizations or the best way to do it, reports bugs too.

some screenshots:







PS: Sorry my english.


Looks great!  I'll be loading this up soon to try it out.

This is definitely something that has been needed.  My only concern would be the FPS…seems pretty low so i hope you've got a crappy video card. :wink:

Probably just needs a little optimization.

probably the card 340fps here


You are right my video card is a GeForce 4 MMX440-SE (128/64 MB) and my PC is too slow

Looking good!  :slight_smile:

Since "time" doesn't change that fast, you don't have to update the colors every frame in the render() method. That should give you a nice performance boost.

yummy. this is just what i needed. it was on my "todo after you fix the some other things"-list :slight_smile:

Thanks llama,

I fixed it and updated the wiki page.

I created a new variable in SkyDome class.

private boolean renderRequired = true;

Changed a update() method:

Did it help your FPS too?

Yes, it helped.

does it have a way to do clouds I saw Q4 map that utilised inner domes to render clouds he used textures and alpha blending I think didn't dig to much into it.


Yes, I saw some paper about it, but, unhappyly I have little spare time to execute it now.


thanks, i will search it, but, i am too busy at moment, when i get to do it, i will post here.


Did you check out the jME game Roverrun?

It also has a pretty awesome dynamic skydome… (you can speed up time as explained on the page) with night effects.

Hi all,

New to jMonkey, I tried to attahced SkyDome to a very large gamefield.

Then I had a bug I thought was misconfiguration but after lost of lost time (well, not so lost, since I had to get into the inside), I figured out it is in the render() method of SkyDome:

- when you move your camera far away for (0,0,0), the sun isn't any more in the halo in the sky.

I corrected it but taking into account the camera position when calculating the sun direction for gamma var:

gamma = FastMath.acos(;

instead of

gamma = FastMath.acos(;

I didn' get all the reasons why it didn't work before... Could someone explain ?


Correction :

I completely missed the point, the problem didn't comme from the gamma calculation, that, in its own referential is correct,

but from the fact that in the update function, the dome is translated, not the SkyDome.

It's the skydome in the whole that muste be translated in order that the sun and halo are correctly positionned.

Else, the sun stayed behind…

Ignore previous post.