Game Development Community

Dynamic skies?

by Mitovo · in Torque Game Engine · 10/17/2004 (1:07 pm) · 44 replies

Hello..

I've been experimenting with the different settings for the sky in Torque and have found what I think would be an excellent solution.

For starters, I'm not a fan of skyboxes in general. They just always look.. "sky-boxy"

I'm much more a fan of dynamic skies where you're dealing purely with a solid colored sky - much like in real-life, with layers of clouds scrolling by.. much like they do in real life.

Through my experimentation I've found it very easy to simulate this effect, even including a starry, evening sky. Here's an attached image to show the results of a 15-minute test...

Sample Image

In case it's not immediately obvious (and it probably is), that effect is achieved by simply turning off skybox textures, setting the sky color to a deep blue, turning on the horizon bands and using a tiling starry sky texture as one of the cloud layers - I have the speed set to .0001, so it scrolls by very slowly. I also have one of the fog layers set up to further add to the effect near the horizon. Not too shabby for 15 minutes of work, I think.

I can also set up a second cloud layer to give it more depth. I'm not sure how a sun or moon would be layered in there to make it appear in front of the stars, but behind the clouds.. but that's sorta the point of this post..

I'm wondering how possible it is to set this up where you can dynamically gradiate through the different sky colors to simulate times of day, and weather... Also, can you change the color of the horizon bands from their default white to some other color? Or.. would this have to be done with "strategically" configured fog layers?

Would this be done via scripting? Or, would it have to be done via changing the actual engine code?

I'd like to implement such a system in a game I'm in the R&D stages of, and just want to know what kind of work it's going to entail.

Thanks a bunch!!

Mike
#21
10/21/2004 (3:43 pm)
We had this running with day/night in Illumina for awhile now and it looks amazing with the sky colours changing over time.

Additionally we have a sun and a moon which will fade in and out during the day/night cycle.

This was running with an old version of torque so where updating it to work with 1.3

But im curious , is it possible to have a merge of the old and the new ? Having a bitmapped sky image but with fractal skys still occuring on a seperate layer ?
#22
10/21/2004 (11:22 pm)
Ian, you can have both by just enabling "useSkyTexture" in the mission editor. That way you'll have BOTH the skybox and the fractal sky. Depending on your skybox, this will look either nifty... or completely silly ;)
#23
10/28/2004 (11:54 am)
I'm not sure if this code is workin (the 1.3.0 version) sometimes when i load up the map it will end program from an error or somethin. And sometimes it loads up without workin and just a plain blue sky. But when it does work it looks pretty good.
#24
10/28/2004 (1:26 pm)
@Alfredo: I asked Josef for the sky files via email, and the files that he sent me work fine with 1.3.0. So either he sent me a different version than he posted here, or you've made some changes to the game that are causing the program to crash.

I'm saying this in hopes that Josef will explain that the files he sent me are different from the files he has listed above as 1.3.0--because if not, the problem's probably on your end.
#25
10/28/2004 (2:46 pm)
The files I sent via email are the same ones as on my webserver. I'd say there's a problem with some other engine modification that you've made. However, I would never rule out a problem with the sky code itself.


Are you using the "celestial day/night" code? If so, do you have a Celestials-object in your .mis ? Did you set the visibility range to something really small? Is this effect limited to certain missions? Have you tried the stock demo mission?
#26
10/29/2004 (12:04 am)
I added Josef's sky .cc and .h files strait into 1.3, and it works great.
#27
11/03/2004 (1:17 pm)
Im trying to mix the sky with the Time and Weather resource and it seems to be giving me bad results lol
#28
11/04/2004 (11:06 am)
You can use that scripted time resource to trigger a sky box switch. To switch a skybox in script, just delete the current one, and spawn a new one with the correct settings. I used that method in one of my Tribes 2 mods, it always freaked people out.

Edit: Or you could just change the sky's settings via script.
#29
11/14/2004 (10:26 am)
Well I tried it in a clean install of torque and seems to work fine now thanks.
#30
11/15/2004 (7:28 am)
I hate to sound like a noob but could you tell me what you did to get your sky to look like the one above? I'm doing it on the fps demo with the sky.cc and sky.h in place. I just dont see where I can change anything besides the fog colors and I don't really have any idea about wich ones to change.

Edit: When I clicked the norenderbands options I got a sky like yours but the horizons objects where grey. and when I have the render bands on I get a dark foggy day
#31
11/15/2004 (7:38 am)
@Charlie, if you're talking about Josef's screenshot, he's using the fractal sky code snippet, as well as the day/night code to achieve that. Do a search for both of those resources, and you should be able to get them in fairly easily(I'm using them too, good stuff!).
#32
11/15/2004 (7:43 am)
Yeah I did the fractal sky snipit I believe. thats how I got the sky.cc file and sky.h for the day code. at least that what I think.
Is that what you mean?
sorry to pester!
#33
11/15/2004 (7:46 am)
That's half of what I mean... If you want to have day/night cycles, there's a resource or three that are around that can help you with that, and that's also what Josef has in his engine, from what he says. But there's also some good info to be gleened from everyone's talk about the render bans and such- it just takes a lot of tweaking too ;)
#34
11/15/2004 (8:11 am)
Got it better. I removed about all the fog and that cleared things up. also raised the visibilty to about 900 and brought the fog distance to about the same thing.
So all is good now.
#35
09/14/2005 (2:39 am)
Ok, the favorite day/night resource seemes to be the "celstial day/night" cycles:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5417

The favorite dynamic weather resource seems to be:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6107

I only have the 2nd one working so far, but they supposedly work really well together. Has anyone used both of these WITH the fractile sky's? It should work since they all do somthing a little different.

As a side note i'm planning on putting together an updated weather resource, as that one hasn't been maintained. All the fixes are in the thread though.

rgds,
Raven
#36
09/19/2005 (10:29 pm)
Does anyone know if it's possible to control individual cloud layers separetly?

For example what if i had the fractile sky on the top layer, always on. Then when it got "cloudy/stormy" the storm clouds turned on, on lower layers, cover up the fractal.

The weather module turns all clouds on and off with:
Sky.stormClouds(1, $time_to_storm); or
Sky.stormClouds(0, $time_to_storm);

Perhaps another function exists or can be written to turn on/off individual layers?


The other option I might look into is "throttleing" the fractal clouds, so I get just enough to texture the sky on a "cloudless day" and somthing more menecing when a storm rolls in.


Does anyone know if either of these options are possible or how they might be achieved? I've been going through the code, but i'm still new to it, and on a very tight time schedule.

Thanks,
Raven
#37
09/20/2005 (9:47 pm)
FYI all:
I just actually tried this so here's an update. If you plug the newer of the two sky.cc and sky.h files into the TGE+LP-1.3.5 engine it works fine!

Also if you take the newer set of files above, and apply the "sky.cc" section of the "celestials" patch to it, by hand it comes out almost perfect. I wouldn't reccomend an automated patch, but manually it's almost a clean deal. Think there was one trouble spot but nothing that wasn't obvious.

I had no lucky what-so-ever with the older "day-night" sky.cc above. Would reccomend stayinging clear of it.

--

One Question:
Has anyone noticed, particulary in the scenario above, a giant lighter colored "hole" in the sky, centered above the camera? It only seems to be visible at sunset/sunrise. I have to do more testing but no idea whats causing it at this point. It's like the very top of the skydome is not changeing colors in time with the rest of the sky.

Anybody, feel free to jump into this convo at anytime! ;-)

rgds
Raven
#38
09/20/2005 (10:01 pm)
Does the visible range effect the skydome? Just a thought.
#39
09/20/2005 (10:20 pm)
Thanks Josef Jahn! For adding the sky.cc and sky.h to that website. I just added them to my project and it works great with LP (1.3.5)!
#40
09/22/2005 (4:43 am)
Just a post to say I used the Celestial Day/Night Resource here at this link www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5417
This integrates by hand easily into TGE and RTS with Lighting Pack also check out the Weather resource at www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6107
The screenshots look great but this will blow your mind this is a complete day night system and I can't say enough good things about it. NOTE: continue the search for the day night resource because there are a couple of more fixes in post for this.