Altitude constraint weirdness

Started by kevnar, June 10, 2009, 12:35:33 am

Previous topic - Next topic

kevnar

I'm trying to make a scene using my own "Wet shores" method. I set up a small pond with fake stones, but when I went to add the wetness to the shores using altitude constraints, the shoreline went off in a whole different direction than the pond's edge. The path seems to be completely random, totally ignoring the actual altitudes of the terrain. As you can see, it actually dips down into the water at one point, goes back up and off into the distance before branching off in two directions.

If anyone can explain how to fix this, I'd be delighted to hear it. Thanks.


Matt

June 10, 2009, 02:32:38 am #1 Last Edit: June 10, 2009, 04:56:03 am by Matt
First the reason why this happens. Then I'll give you a solution :)

Altitude constraints in the Surface Layer are based on the "position in texture/terrain" (a.k.a. texture coordinates), not the final displaced position. This is so that colour and displacement are based on the same altitude constraints, and displacements don't have access to the final displaced position and can only be based on the texture/terrain coordinates.

The texture coordinates are computed by the Compute Terrain and are a slightly smoothed version of the actual terrain. That allows the difference between actual terrain and computed terrain to be used by other special effects such as the "intersect underlying" feature.

Workaround: The Distribution Shader has an "altitude key" setting which allows you to choose between "position in texture/terrain" and "final position". Final position should give you something that aligns with the shoreline. You can use a Distribution Shader as a blend shader for your wetness layer.

I plan to add the same option to the Surface Layer in future.

Any remaining discrepancy between altitude constraints and water level can be explained by the difference between 'Y' and 'altitude'. The water level is specified by altitude. Coordinate readouts in the 3D Preview are 'Y' coordinates, which may be slightly different from the altitude due to planet curvature.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

rcallicotte

 :o

Cool. 

Quote from: Matt on June 10, 2009, 02:32:38 am

I plan to add the same option to the Surface Layer in future.


Matt



And thanks for explaining this.
So this is Disney World.  Can we live here?

bobbystahr

well 'splained Matt...had a run in with this problem a while back and came to the same solution, but it's good to have it written
down for others/noobs to come to grips with it.  ..   ...
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist