Planetside Software Forums

General => Terragen Discussion => Topic started by: AirWolf on January 04, 2007, 11:11:39 AM

Title: No clouds on Horizon
Post by: AirWolf on January 04, 2007, 11:11:39 AM
I'm creating a skybox for a game and I need to have a "clean" horizon.  Basically, I have a flat terrain that goes into the horizon.  At the horizon, I want a nice white haze that fades into the blue sky.  I only want my clouds to start rendering further up.  If I increase my cloud height, it just pushes the clouds up into the atmosphere, makes them smaller and they still appear on the horizon.  Is there anyway to force the clouds to start rendering about a certain level while still having them appear large in the upper atmosphere?

I have attached an example of what I would like to happen.



Title: Re: No clouds on Horizon
Post by: Tim O'Donoghue on January 04, 2007, 11:26:59 AM
Remember that T2 uses a globe model. Clouds will always appear on the horizon unless they are randomly not there for your particular POV
Title: Re: No clouds on Horizon
Post by: Njen on January 04, 2007, 11:29:25 AM
Yeah, what Tim said. You could do a planar projection of an image mask from the top. I think
jimB was experimenting with this...
Title: Re: No clouds on Horizon
Post by: oggyb on January 04, 2007, 12:24:16 PM
I'm sure you could use a distance shader as a mask or something.
Title: Re: No clouds on Horizon
Post by: Njen on January 04, 2007, 12:29:10 PM
I tried to use the distance shader in relation to masking clouds, but for the life of me I could not get it working. I have had no problems getting it to work on shaders on the terrain, and scattering other objects though...if anyone can provide a working setup, I'd be interested too :)
Title: Re: No clouds on Horizon
Post by: AirWolf on January 04, 2007, 12:38:35 PM
Quote from: Tim O'Donoghue on January 04, 2007, 11:26:59 AM
Remember that T2 uses a globe model. Clouds will always appear on the horizon unless they are randomly not there for your particular POV


So could you make your planet flat instead of round?

After all, some people still believe our world is flat.   ;D
Title: Re: No clouds on Horizon
Post by: JimB on January 04, 2007, 03:15:01 PM
You could try creating a circular texture map (black where you don't want clouds, white circle where you do, and make the image a square - 2048x2048), use it for a new Image Map shader, choose the projection to be in the Y, and then scale the image map to super-huge so that the projection of the circle ends just above the horizon. Then choose that Image Map in the cloud's fractal shader for your blending input.

I suspect it will take a lot of resizing of the Image Map's scale, and experimentation with the type of gradient. Bear in mind that the edge of the white circle will always be incredibly sharp at those distances if it's a bit blurred. You may need to do some counter-intuitive stuff with how the gradient of the circle ramps away from the centre.

Make any sense?  :-\
Title: Re: No clouds on Horizon
Post by: buchvecny on January 04, 2007, 03:35:54 PM
noise stretch? maybe
Title: Re: No clouds on Horizon
Post by: JimB on January 04, 2007, 03:56:13 PM
It definitely works. Best to have the Image Map centred, not lower left. You need to load in your own texture into the Image Map node.


Title: Re: No clouds on Horizon
Post by: AirWolf on January 05, 2007, 01:24:56 PM
Quote from: JimB on January 04, 2007, 03:56:13 PM
It definitely works. Best to have the Image Map centred, not lower left. You need to load in your own texture into the Image Map node.




Could you post a small pic of what your image map looks like?  Thanks a mil!

Edit: I created one in PS and it worked great!  Thanks so much for your example.  I would have never figured out that without looking at your example. Thanks again!
Title: Re: No clouds on Horizon
Post by: AirWolf on January 05, 2007, 02:09:47 PM
The only problem I have with using an image map is that in order to render 4 sides of a skybox (front, back,right,left), I have to rotate and create another image map for the side I'm rendering.  So to render the right side, I rotated the image map 90 degrees and saved it under another name.  This is kinda of a pain but I guess I can live with it.  If anybody knows of a way around this I would greatly appreciate it.  Thanks!

Title: Re: No clouds on Horizon
Post by: Oshyan on January 05, 2007, 10:13:35 PM
I think a simpler approach would be to use the same image "masking" approach (I presume you're using the image map as a blend shader for your cloud Density Shader) but use "Through Camera" projection. Then you can just paint a mask over a basic render of the scene to specify exactly where and how you want clouds to be shown. A simple white (top) to black (bottom) gradient ought to give you the effect you want. Create the mask and load into the Image Map shader as usual, with "Through Camera" for the projection.

- Oshyan
Title: Re: No clouds on Horizon
Post by: Njen on January 05, 2007, 10:20:56 PM
Oshyan, do you know for sure if the Distance Shader works with 3D clouds?
Title: Re: No clouds on Horizon
Post by: JimB on January 06, 2007, 07:19:48 AM
Quote from: AirWolf on January 05, 2007, 02:09:47 PM
The only problem I have with using an image map is that in order to render 4 sides of a skybox (front, back,right,left), I have to rotate and create another image map for the side I'm rendering.  So to render the right side, I rotated the image map 90 degrees and saved it under another name.  This is kinda of a pain but I guess I can live with it.  If anybody knows of a way around this I would greatly appreciate it.  Thanks!
I don't see why that would happen? The image map should be extending nrth, south, east and west from the centre, so the same effect should happen in every direction you look.  ??? But, Oshyan's method would work, although I suspect the end result would be different where the clouds wouldn't clip in distance, but in altitude. This just means there's more choice  ;)
Title: Re: No clouds on Horizon
Post by: Oshyan on January 07, 2007, 04:22:33 PM
Yes, I'm fairly sure the distance shader does work with this kind of thing. I do believe there's another thread on the forums discussing its use, in fact. http://forums.planetside.co.uk/index.php?topic=111.0

- Oshyan
Title: Re: No clouds on Horizon
Post by: Njen on January 07, 2007, 05:01:39 PM
I read that thread, and tried over and over to get the distance shader working with 3D clouds, and I couldn't do it. I tried every little value and check box, but I couldn't get it working.