Game Development Community

Advanced Cloud Layer

by Sigmund Haugland · in Torque 3D Professional · 04/26/2011 (3:57 am) · 15 replies

I have a issue with how the Cloud Layer works and worder if someone can enlighten me. I would like to get the cloud layer all the way down to the horizon line, and altering the height property seems to do other stuff than just setting the height of the clouds.

With the height set low at "4" the clouds looks as intended but the horizon is not covered by it.
www.badunclegames.com/images/cloud_error_4.png
Setting the height to 100 pulls part of the clouds down towards the horizon but not the entire cloud layer, also the clouds get distorted and looks very different depending what direction you look.
www.badunclegames.com/images/cloud_error_100.png

Is this intended and if so, how would it be possible to get clouds in the horizon?

Thansk in advance

About the author

Artistic lead at BadUncleGames, developing ALBA, a historic mmo set in the medieval Scotland.


#1
04/26/2011 (6:26 am)
Weird - looks a little like virga....
#2
04/26/2011 (6:45 am)
Whats your fog colour and settins, is that the fog at distance causing the clear horizon ?


[edit]

forget that, its nothing to do with fog. making it as extreme as i can, it just cuts too short on the fade

www.mediafire.com/imgbnc.php/fb9ebeef9c0c98c1eaf56400f87bdcac056b58282d88742ebab4ae4ee4e076854g.jpg
Suggestion - make the clouds a bit of a dome if possible, so it pulls down into the "corners" of the scattersky
#3
04/26/2011 (9:14 am)
That was my first thought, too - fog. Perhaps some fiddling with the scattersky settings or something. I'm sort of leaning toward a regular skybox for my project and calling it good - too much tinkering involved with this other stuff.
#4
04/26/2011 (10:13 am)
There was a z-offset hack/Resource for the Scattersky-CanvasColor ugliness... I assume that a similar hack could be applied to the CloudLayer...
#5
04/28/2011 (12:03 pm)
Fog settings has as you have said nothing to do with this. Using fog we can minimize the error and fog on a clear day aint too nice... Not sure i follw what you think of when you say

Quote:make the clouds a bit of a dome if possible, so it pulls down into the "corners" of the scattersky

as i thought the clouds have to be a seamless image for it to render properly...and pulling it down into the "corners" is what i am not able to do...

Have seen that z-offest resource
www.garagegames.com/community/resources/view/20788
but as i am s novice when it comes to code i have not poked our coders with it yet, but might be a easy fix.

Still dont answer what the height setting does though.... :)
#6
04/28/2011 (1:01 pm)
Quote:
Suggestion - make the clouds a bit of a dome if possible, so it pulls down into the "corners" of the scattersky
Quote:
Still dont answer what the height setting does though....

Seems to me that the above 'suggestion' is what the height setting of the Cloud Layer does:
Quote:
height (TypeF32)
Abstract number which controls the curvature and height of the dome mesh.

The greater the height setting then the steeper the arch of the cloudDome from the horizon to overhead - which is where/how the apparent stretching of the cloud layer is coming from.

I haven't tried it yet, but glancing over scatterSky.cpp and cloudLayer.cpp I see that both are similar enough that the same zOffset trick *should* work for both.
#7
04/28/2011 (2:02 pm)
I see people are discussing my hack here. Guess it's time to join the conversation.

Quote:There was a z-offset hack/Resource for the Scattersky-CanvasColor ugliness... I assume that a similar hack could be applied to the CloudLayer...
Yes, tested, it can.
However, if you'd be elevated higher over the horizon you'd still get the same result.

It seems a combination of the height value and the zoffset might be able to give you the effect you want:
Before:
img90.imageshack.us/img90/5558/screenshot00800001.jpg

After:
img830.imageshack.us/img830/9863/screenshot00800000.jpg
You might wanna do some trickery to get the horizon clipping to look better

Quote:but as i am s novice when it comes to code i have not poked our coders with it yet, but might be a easy fix.
This should be a easy & painless task :P

EDIT: I suppose it wouldn't be too difficult to get the skies to render further... Might look into that.
#8
04/28/2011 (9:30 pm)
FYI.

In all the screenshots here in this thread the sky/clouds go down to the horizon line.... but your world (aka terrain) does not. This is the reason for the gap... your terrain doesn't reach the horizon.

The sky and clouds could be modified to build geometry under the horizon line, but it would be to the sacrifice of fillrate spent on unseen geometry under the terrain.
#9
04/29/2011 (2:59 am)
I would think that using a water plane set at Position: 0 0 0 would make the horizon line and not the terrain used as that will never extend infinit? but please correct me if i am wrong...


Quote:The greater the height setting then the steeper the arch of the cloudDome from the horizon to overhead - which is where/how the apparent stretching of the cloud layer is coming from.

Thanks that explains it in a language i can understand :D

Our code guy have now started to add in the z-offset hack so will post back whit the result when i get a look at it.
#10
04/29/2011 (3:28 am)
Quote:using a water plane
The water plane is designed to fake a far horizon without needing to set your far plane to a crazy distance.

We've never gotten time to do it, but i always wanted to get ground plane to do the same.
#11
04/29/2011 (3:53 am)
Ok so if i follow you correctly on this, the waterplane is actually not extending infinite and therefore never goes all the way to the teoretical horizon of the scattersky/clouds? If its so, why aint the horrizon of the waterplane then draw to the same line as the visible sky/clouds horizonline so it looks like it should do? :)

#12
04/29/2011 (1:09 pm)
Quote:the waterplane is actually not extending infinite and therefore never goes all the way to the teoretical horizon of the scattersky/clouds?
You got half of that right.

The water plane does not physically extend infinitely, *but* it does fake it to make it appear that it does.

For example you can set the far plane to 100 meters and drop in a water plane... it still looks like it extends to the horizon.

Do the same thing with a ground plane and you'll see it cuts off exactly at 100 meters from the player.
#13
05/03/2011 (5:18 am)
Adding in the z-offset hack for the cloudlayers is working ok for us

www.badunclegames.com/images/cloud_fixed.png
Thanks a lot guys :D
#14
05/03/2011 (10:48 am)
for us non code moneky guys.. can someone post the exact lines and in which files to put the z-offset hack?


thanks
#15
05/05/2011 (12:05 pm)
@ Donald
Thought i that was clear in my resource. Well, if you want me to spare you some time, send me an email with your email address in it (my email is located in my profile) and I'll send you my files.

@ Sigmund
Cool! Glad it worked.