Is hiding clouds possible?

Started by treddie, January 05, 2011, 12:39:50 AM

Previous topic - Next topic

treddie

Hi.

Is there a shader that can mask out clouds within a specific range from the camera?  I was playing around with some cumulous clouds, and they looked good close up, but were too busy far away.  If I made them more simple in the background, they were WAY too simple and cartoon-like in the foreground.  It would be neat to do three sets of clouds, all duplicates of each other, but with the foreground clouds having their smallest scale and feature scale set different then an intermediate range of clouds, and those different from the background clouds.  The idea being to blend them all together in a "seamless" progression from front to back.  I don't want to create three sets of different clouds because often, I like the composition of the single cloud layer I have, I just need to be able to treat that cloud layer differently with respect to distance from the camera.

Dune

#1
Very easy; blend them by one or several distance shaders (from color shaders list). Make one or two copies of the initial cloud fractal, and change that slightly. You'd have to figure out the best distances. Don't forget that if you blend (or invert blend) your cloud fractal, you cannot really use the slider in the cloud to adjust coverage, but have to use the density slider in the fractal.

Henry Blewer

A way to figure out the distances from the camera/s in the distance shader, is to use the View Menu, 3D Preview Location. When this window is open, you can move the mouse over the preview window. The location and distance from the camera is shown. Makes things a little easier. :)
http://flickr.com/photos/njeneb/
Forget Tuesday; It's just Monday spelled with a T

treddie

Thanks for the responses.

njeneb > I was wondering about EXACTLY that when I was trying to guestimate distances.  Nice idea.

Dune >  I tried a distance shader thinking that was what I needed to use, but I couldn't get it to work.  So I am obviously missing something.  I will have to bone up on the usage of it.

Thanks for the direction!

Henry Blewer

The distance shader uses a camera for its center. Find a POV which shows the area where you think you may like the new camera to be. Use the right mouse button and copy coordinates. Click on the camera tab and add a new camera. Paste the coordinates for the camera. All that is left to do is add the distances and rotae the camera to the proper angle.

You can return to the Render Camera view and watch the preview. This will help get the camera angle right and let you see the results of the distances.
http://flickr.com/photos/njeneb/
Forget Tuesday; It's just Monday spelled with a T

treddie

Where exactly do you place the distance shader node?  I have tried putting it as the input to the density shader, the cumulous node, inbetween, etc.  It seems it has to be applied to just the cumulous layer somehow to tell it what to do, without affecting any other cloud layers.

It seems in my tests that using 3D Preview Location only sees hard surfaces.  When I try to get even a rough idea in the clouds, I simply get a huge number (about 200,000) which I assume represents the distance limit in the TG2 universe with respect to the camera.

dhavalmistry

Quote from: treddie on January 05, 2011, 11:35:52 PM
Where exactly do you place the distance shader node?  I have tried putting it as the input to the density shader, the cumulous node, inbetween, etc.  It seems it has to be applied to just the cumulous layer somehow to tell it what to do, without affecting any other cloud layers.

You have to put it as blending shader


Quote from: treddie on January 05, 2011, 11:35:52 PM
It seems in my tests that using 3D Preview Location only sees hard surfaces.  When I try to get even a rough idea in the clouds, I simply get a huge number (about 200,000) which I assume represents the distance limit in the TG2 universe with respect to the camera.

Yes you are right about that.....I usually spend some time figuring out the distance by trial and error.
"His blood-terragen level is 99.99%...he is definitely drunk on Terragen!"

treddie

OK!  I'm getting the distance shader to work now.  I finally figured out that it's output had to be connected to the density fractal's input.

treddie

The distance shader controls are rather confusing and there does not appear to be any in-depth reference to read to sort it out.  For instance, why is there a near and far color?  Why not just have a near and far distance to bracket the area you want to see?  I get very confusing results trying to sync-up the color and distance functions.

Dune

#9
Because it can be used for other things as well, like a color gradient (for macadam/asphalt roads, e.g.). You should see the colors as a mask, with the distance it says where to allow things and where not. Why don't you attach a distance shader to a color input of a surface layer (temporarily as the only node between compute terrain and planet), and see what it does. It's easy to test out distances this way, with this 'testlayer'.
If you make the color black a tint of gray, you have 'a little' of whatever you're masking.

dhavalmistry

one thing I miss in distance shader is the fallof controls....
"His blood-terragen level is 99.99%...he is definitely drunk on Terragen!"

Tangled-Universe

Quote from: treddie on January 06, 2011, 01:13:27 AM
The distance shader controls are rather confusing and there does not appear to be any in-depth reference to read to sort it out.  For instance, why is there a near and far color?  Why not just have a near and far distance to bracket the area you want to see?  I get very confusing results trying to sync-up the color and distance functions.

All found on these forums just by using the search function ;)

http://www.nwdanet.com/terragen-tutorials/8-distance-shader-magic.html
http://www.nwdanet.com/terragen-tutorials/9-dof-effect.html

And there's lots more, but with these 2 there's little chance you'll need more explanation.

dhavalmistry

thanks TU.....I wasnt aware of this!
"His blood-terragen level is 99.99%...he is definitely drunk on Terragen!"

treddie

Neither was I.  I searched but didn't find anything like this.  So I guess I need better glasses!  :)

I have to wait till tomorrow to play with the shader, and your suggestion about gradient, Dune.  I will post my experiences with it.

treddie

#14
OK, I SOOORRT of see it now.  I tried your test, Dune, and I can see how easy it is to apply to a terrain.  As far as I could tell, Near Distance is the distance from the camera that the Near Color appears solid and uniform all the way back to the camera.  Conversely, Far Distance is the starting distance at range, beyond which the Far Color appears solid and uniform out to the farthest distance possible in the TG2 universe.  Between these two distances is the transition zone where the two colors transition from one to the other.  It APPEARS that if I turn off "Apply Far Color", for instance, the distance shader is still applying the algorithm to the far area, but since the color is turned off, the far area is transparent (masked out).  Therefore, the gradient shades from a solid near color below the near distance, then fades to 100% transparency at the far distance.  From there out to infinity, 100% transparency persists.

But...when I try to apply this to a cloud layer, I get strange results.  Please see the attached tgd file.  I applied yellow as a far color, green as a near color, yet my clouds don't render at all except for a red (!?) area down at the bottom right.  I have tried placing the distance shader node at different points in the network to no avail.