No clouds on Horizon

Started by AirWolf, January 04, 2007, 11:11:39 am

Previous topic - Next topic

AirWolf

January 04, 2007, 11:11:39 am Last Edit: January 04, 2007, 11:14:42 am by AirWolf
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.




Tim O'Donoghue

Remember that T2 uses a globe model. Clouds will always appear on the horizon unless they are randomly not there for your particular POV

Njen

Yeah, what Tim said. You could do a planar projection of an image mask from the top. I think
jimB was experimenting with this...

oggyb

I'm sure you could use a distance shader as a mask or something.

Njen

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 :)

AirWolf

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

JimB

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?  :-\
Some bits and bobs
The Galileo Fallacy, 'Argumentum ad Galileus':
"They laughed at Galileo. They're laughing at me. Therefore I am the next Galileo."

Nope. Galileo was right for the simpler reason that he was right.


JimB

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.


Some bits and bobs
The Galileo Fallacy, 'Argumentum ad Galileus':
"They laughed at Galileo. They're laughing at me. Therefore I am the next Galileo."

Nope. Galileo was right for the simpler reason that he was right.

AirWolf

January 05, 2007, 01:24:56 pm #9 Last Edit: January 05, 2007, 01:50:31 pm by AirWolf
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!

AirWolf

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!


Oshyan

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

Njen

Oshyan, do you know for sure if the Distance Shader works with 3D clouds?

JimB

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  ;)
Some bits and bobs
The Galileo Fallacy, 'Argumentum ad Galileus':
"They laughed at Galileo. They're laughing at me. Therefore I am the next Galileo."

Nope. Galileo was right for the simpler reason that he was right.

Oshyan

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