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

CCC

February 07, 2010, 02:43:41 amLast 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.

CCC

February 07, 2010, 05:26:47 am #2
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

February 07, 2010, 05:58:48 am #3
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

February 07, 2010, 08:31:08 am #4
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

February 07, 2010, 12:27:39 pm #5
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

February 07, 2010, 03:58:54 pm #6
Alrighty, sorry for taking long to reply but i will indeed try your advise as soon as i can.

Matt

February 22, 2010, 03:28:06 am #7
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.