Distance Shader Issue

Started by CCC, February 07, 2010, 02:43:41 am

Previous topic - Next topic

CCC

February 07, 2010, 02:43:41 am Last Edit: February 07, 2010, 02:46:54 am by CCC
I have a problem and here it goes. I am using a displacement shader to flatten the area outside of my center zone of which i want left unaffected by the flattening. I am using a distance shader attached after the subtract, clamp, and constant shaders attached to the displacement function connection but as i am moving the far distance and near distance back and forth, nothing happens at all.

FrankB

I'm confident I can help you, but would need to see your node network.

CCC

OK. Here is what i have. The disconnected nodes are of course what i was trying use to flatten outside the boundarys i wanted to keep elevated.

FrankB

ok, so without truly understanding what you are trying to do, 2 things spring to mind:
1 - use "get altitude in texture" instead
2 - get altitude will always return 0, because TG2 will continue to assume a perfect sphere, as you haven't computed the tex coords yet in this chain of nodes.

Just remember that you need to "tex coords from xyz" whenever you try to call the altitude in the texture, also when you want to work with an altitude constraint.
Compute normals if you need to use slope constraints for something.
Compute terrain when you need both correct altitude and slope constraints :)

Hope that helps a bit,
Frank

Henry Blewer

I have never used the 'tex coords from xyz' when using an altitude constraint. But I use distribution shaders, so I don't think it would be necessary for them. Would using 'tex coords from xyz' make any difference using distribution shaders?
http://flickr.com/photos/njeneb/
Forget Tuesday; It's just Monday spelled with a T

FrankB

doesn't have much to do with one another. tex coords computes the new coordinates to which the terrain has been displaced to. It's an important pre-requisite, that the tex coords have been computed, before the altitude constraints in your distribution shader would make any sense.

Regards,
Frank

CCC

Alrighty, sorry for taking long to reply but i will indeed try your advise as soon as i can.

Matt

Quote from: FrankB on February 07, 2010, 05:58:48 am
ok, so without truly understanding what you are trying to do, 2 things spring to mind:
1 - use "get altitude in texture" instead
2 - get altitude will always return 0, because TG2 will continue to assume a perfect sphere, as you haven't computed the tex coords yet in this chain of nodes.


Actually it's the other way around. You need to use Get Altitude, because Get Altitude in Texture remains at 0 until it is updated by either a Compute Terrain or a Tex Coords From XYZ node.

If you add a Tex Coords from XYZ node, as in your later suggestion, then either of the altitude functions will work.
Just because milk is white doesn't mean that clouds are made of milk.