View Full Version : Controlling a Channel of One Surface by the Distance of Another

03-28-2008, 10:27 AM
I've hit a brick wall with this, not even sure if it's possible.....without delving into math anyway.

I've got two objects, one surface each - a river channel object and a plane for the water.

I would like to control the surfacing of the water according to the depth of the river channel surface below it.

I've spent way too long on this now, nothing I can think of works - the more standard 'distance to' setups don't work for this; it's almost like I need a Spot Info for each object, subtract the river channel from the water and send that to a gradient input, give or take. Except you can't of course.....Item Info is no good for this as it seems to output only a centre or pivot location.

There are more traditional ways I can do some of what I want - weightmaps, obviously - and if the banks of the river are fairly linear, Raycast kind of works for 'bouncing' a gradient off each river-bank.

But I'm wondering if it's possible to control one surface, spot by spot, by the distance of another surface's spots, as it were.



03-28-2008, 12:45 PM
Perhaps a gradient based on thickness?

03-28-2008, 01:03 PM
Perhaps a gradient based on thickness?

I did look at that - still looking just in case - but the docs specify that it fires a ray from the current hit point (very ambiguous, statements like that - to me anyway :)) to the back of the object. The only control is IOR.

Perhaps this is where (and why) all the comments about global nodes and sub-nodes come into play. To me, being able to set nodes to return the length between two surfaces, like if Spot Info had a selection for what object or surface it was outputting, this would seem very straightforward.


03-28-2008, 01:38 PM
Gradient Layer Surface Thickness of Layer Node,
works well, in DP Kit the Layer+ node has also
an axis thickness (x,y or z) gradient layer,
classic camera + raytrace or perspective camera.


03-28-2008, 02:28 PM
That's it!! That's what I was after.....geez.....the hours I've spent poring over stuff I really don't understand and shouldn't be playing with anyway :D

The attached example is hideous, but it's my test landscape with a randomly carved out valley, simple water plane object, with three Layer+ nodes from DP Kit, two scalar, for transparency and luminosity, and one colour.

All I did was apply these to the water object/surface, set the gradient layers to Y Thickness and seemingly they have detected the surface beneath them - plugged the outputs straight into main Surface node.

So is the thickness evaluated both positive and negative along the chosen axis from the surface, in this case the water surface?

I really don't know how that does it, but it works a treat - thank you very much indeed Denis :D:thumbsup: