Planetside Software Forums

General => Terragen Discussion => Topic started by: kevnar on June 16, 2009, 09:39:46 PM

Title: Constraining clouds
Post by: kevnar on June 16, 2009, 09:39:46 PM
Is it possible to constrain a cloud to certain coordinates, or is it always a global atmosphere thing? I'd like to be able to stick just one cloud in one part of the sky and say, "Here! Stay put!" Can I do that?
Title: Re: Constraining clouds
Post by: neuspadrin on June 16, 2009, 10:03:08 PM
You can use various shaders to constrain them, such as distance shaders.

Dandelo also created a meta cloud download, which lets you build your own cloud

http://forums.planetside.co.uk/index.php?topic=3691.msg50489#msg50489
http://forums.planetside.co.uk/index.php?topic=4844.0
Title: Re: Constraining clouds
Post by: Tangled-Universe on June 17, 2009, 02:55:52 AM
Neuspadrin gave you option #1, here's #2:

Create a camera and move/position it where you want your cloud.
Create a distance shader and attach the camera to it's camera input port.
In the distance shader define the size of the distances with the far and near distance values.

Use this combination of 2 shaders as blendshader for your cloudfractal, et voila!

Martin
Title: Re: Constraining clouds
Post by: Goms on June 17, 2009, 04:17:41 AM
For #2 you have to adjust the height also. its a little bit tricky, the distance shader uses not only x/z but also the y coordinates for the distance.
Title: Re: Constraining clouds
Post by: schmeerlap on June 17, 2009, 07:07:24 AM
Quote from: Goms on June 17, 2009, 04:17:41 AM
For #2 you have to adjust the height also. its a little bit tricky, the distance shader uses not only x/z but also the y coordinates for the distance.

As I understand it spherical distance mode does use all three coordinates; the clouds will be confined in the huge bubble determined by your near and far distance parameters, and that bubble's position is determined absolutely by the xyz coordinates of the camera you're using. However Z depth (planar) mode is not height dependent in the same way. The best analogy I can think of for the planar mode is that of a croupier dragging your chips away from you with his/her rake-thingy (what's the technical term for that device he/she uses to impoverish you). So, using the planar distance mode you can place a camera next to the render camera and push the clouds away from you along the path the camera is pointing. Rotating the camera on the Y axis changes the direction the clouds will be pushed away from the camera (and you).
As long as the X and Z camera coordinates approximate the render camera's you won't change the cloud placement by raising or lowering the camera (in planar distance mode). It's the direction the camera is facing (rotation on Y axis) that's important, along with the near distance and far distance parameters.

John
Title: Re: Constraining clouds
Post by: Tangled-Universe on June 17, 2009, 07:23:56 AM
Quote from: Goms on June 17, 2009, 04:17:41 AM
For #2 you have to adjust the height also. its a little bit tricky, the distance shader uses not only x/z but also the y coordinates for the distance.

Correct, forgot to mention that :)