Page 1 of 10

ATMOsphere

Posted: Mon Jan 09, 2006 11:42 am
by Pazystamo
Hi, i am beginer with Irrlicht, and trying to create day/night loop with sky hemisphere (half sphere).Project for now is named "ATMOsphere" and it's my first work with Irrlicht. :) I choose this work as my term paper at university, so it must by finished until july. :) My main goals are:
create dynamicaly textured hemisphere with sky color which depend from sun position/day time(gradient colors from day time based palette). Also to set ambient acording to time(maybe dynamic light).Later (not on term paper) maybe add clouds layer, make sky color depend from year time (on winter darker,on sumer nice clear sky,random weather generator) and maybe add weather efects(rain,snow).

For now, in two days (i hate debuging) i made buildin hemisphere custom scene node and dynamicaly (refreshes on given time interval) generated sky texture from sky colors palette. This work slowly (i have full time job and studies) ,but will be finished,because i need my mark. :)

when i have something interesting to show i'll write here (after two weaks,now exams...).
I hope you will help me when i need :) Now i'm reading forums, manual and trying to make something...

EDIT:
HI,
I have some good and some bad news ;). Good is that i released source and demo. Bad - project is unfinished and almost without coments, also untidy code :oops: . I took academic holiday and don't have time and desire. But i plan to finish it next year, after my holiday. Now it is only with sun, no moon, but you can add moon formulas from here.
Also you can add light to sun position.
Download from site is closed, PM me and i will email you source.

Posted: Mon Jan 09, 2006 2:40 pm
by Guest
good luck. :wink:

Posted: Mon Jan 09, 2006 2:42 pm
by dhenton9000
This would be really cool!!

Posted: Mon Jan 09, 2006 3:06 pm
by bitplane
we really need a good skydome, i've been thinking about making one for a while. are you aiming for accuracy or beauty (or both?)
sounds like a fun project! :)

Posted: Mon Jan 09, 2006 5:36 pm
by Halan
yeah lookin forward to it...

Posted: Tue Jan 10, 2006 8:48 am
by Pazystamo
bitplane wrote:we really need a good skydome, i've been thinking about making one for a while. are you aiming for accuracy or beauty (or both?)
sounds like a fun project! :)
Well, i'll try both :) Here is yesterday screenshoot (terrain from examples), no sun and lights.Only sky color. In program you need only 3 lines of code to get this (and no texture) :)
http://pazystamo.projektas.lt/test1.jpg
If you know where to find nice sky photo then write here. It will help alot, because i need to know how scanges sky color on diferent day/year/weather time.

Posted: Thu Jan 12, 2006 11:14 am
by Pazystamo
Here is yesterdays results (i had to prepare for todays exam,but work here because its more interesting :) ) :
1.I tested with hemisphere and cone and decided that cone is better.Hemishpere uses 16 segments and has 160 faces .Cone uses 64 segments and has 64 faces and look much better. Here is comparison: http://pazystamo.projektas.lt/cone.jpg
As you see with cone circle is smooth and with sphere its wavy due less subdivisions.

2.Tested stars with 512 and 1024 textures. 512 looks blured (stars are just noise). I know that not all video cards suports 1024 textures so i'm thinking to make cones quarters with 4 512*512 diferents textures.This is just for sky testing,for stars i plan to use separate rotating sphere.
http://pazystamo.projektas.lt/stars.jpg

3.Here is my draft with objects orders.
http://pazystamo.projektas.lt/draft.jpg
It can change during creation time,but for now its good for me. Sun and moon will be behind transparent clouds layer, stars sphere behind sky cone.At night sky cone has transparate texture with only hase in horizont. I decided to make realistic (on sumer sun is high,on winter low) sun/moon rotation,because its not very hard to implement. Texture maping for sky is circle (looking from top) and its easy to generate radial texture.

Thats all for now, next week i have 3 exams,sisters wedings and girlfriends mothers birthday so no time for coding :( If you have some good suggestions please say it :)

Posted: Thu Jan 12, 2006 12:10 pm
by bitplane
nice research work!
i was thinking for the moon, you'll need a black circle that blocks out the stars drawn behind the sky, and a white alpha blend moon in front of the sky. otherwise either your moon isn't gonna glow, or your stars will shine through it.

Posted: Thu Jan 12, 2006 12:11 pm
by finger007
Hi Pazystamo!

If you're still looking for sky-photos, try the following:

http://www.lfgrafix.com/grafix/SkyBasic-1.html

found it via

http://www.amazing3d.com/texfree.html

Good luck with your termpaper. I'm looking forward to see your results. Realistic skydomes would be wonderful!

Cheers,
finger007

Posted: Thu Jan 12, 2006 1:15 pm
by Pazystamo
well bitplain, i was thinking sun and moon make separate bilboard models alignet to camera. It would be moon with alpa blended glow. Glow color would be adjusted according to sky color behind moon and sun position behind earth, center would be changeble moon texture (fool moon/waning moon, also it depends from moon position). I searched encyclopedia and now have sun,eath moon rotation intervals and axis angle.Now some day i'll create formula to calculate sun /moon position.
Ok,now i'm going to work... :?

Posted: Fri Jan 13, 2006 1:16 pm
by Pazystamo
Hi,
Today i searched for formulas to calculate sun position and found... It needs to calculate 11 formulas (mostly sin,cos) to get sun pos in world with given date, time and latitude,longitude (now you can set your home place in game :) ). 3 formulas to convert time to Julian Day Number (need in formulas) and 14 formulas if you want convert time back. I hope it won't take very long and won't be frame drop,because i'll need update pos only at set time intervals. So... now i hope some day i try to create demo to test sun movement.

Posted: Sun Jan 15, 2006 4:45 pm
by Pazystamo
Finaly i made small sun movement demo! You can download it from here:
http://pazystamo.projektas.lt/
Its still buggy but you can see how sun moves in some place around Briusel(i test with its longitude) at 2004 april 1 on 12.00 (midday). Time in console is UT (universal time, known as Greenwich time), i still have problem with time,maybe i convert it wrong,because sun rizing at 13.00. I havent time for this now (tomorow exam), but after week i start work with it.
Data in console:
J - time in Julian calendar (one minute is 0.00070).
dJ - delta time (time from last sun movement)
x,y - sun pos in degrees.
dt-timer delta time.
next line is virtual time (Julian time converted to grigalian calendar(our time))
time is not working now how it shoud. In demo you need files from irrlicht media folder, copy detailmap3.jpg, terrain-heightmap.bmp and terrain-texture.jpg to demo folder. Also need Irrlicht.dll v14. I make small demo size,because my bandwidth are low...
There are 2 exe in zip,slow and fast demo. In slow sun moves every one virtual time minute.One minute takes 14 real time seconds, so day takes 5,6 hour in real time (i think its normal time for game), in fast demo i simply set faster update time and dont know how it takes for day.Sun just jump to new pos, so i plan to make interpolation between now pos for smoth movement.

sun is simply billboard with disabled z buffer, and it has dellay if you move camera( for now).Sky color is static, demo demonstrates only sun movement. Please write if it looks natural and how many fps you get (mine is 85-90 with gf5500 ,256ram,1000GHz).

Posted: Mon Jan 16, 2006 2:28 pm
by Ronin
I would love to see this in action, but unfortunately I get an "entry point not found in Irrlicht.dll" error. I copied the Irrlicht.dll from 0.14 in the same folder...

Posted: Mon Jan 16, 2006 2:52 pm
by Snake
Ronin wrote:I would love to see this in action, but unfortunately I get an "entry point not found in Irrlicht.dll" error. I copied the Irrlicht.dll from 0.14 in the same folder...
I got the same problem, with both Irrlicht 0.12 and 0.14 dll's....
Pazystamo, do you use a modified version of the engine?
Your work seems very intresting, I'd like to see your achievments :)

Posted: Mon Jan 16, 2006 2:53 pm
by Vox
@Ronin - use gcc version

@Pazystamo

Could not load terrain, because file could not be opened.: terrain-heightmap.bmp