OctaneRender Standalone - how to place scattered objects on top of displaced geometry with "Values" nodes

Tutorials for OctaneRender - demonstrations and howto's.
Post Reply
User avatar
bepeg4d
Octane Guru
Posts: 10427
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

Hi,

Here is an example on how to place scattered objects on top of displaced geometry with "Values" nodes:
ScatterOnDisplacement.zip
(39.02 KiB) Downloaded 15 times
Let's say that we have a plane with displacement texture on it, and we want to scatter some little boxes on top of it:
IMG_5633.jpeg
First thing to do is to make sure that the Displacement texture Color Space is set to "Non-colo data":
IMG_5634.jpeg
Then we need to set the Translation mode of the Scatter on Surface node to "Map", and connect the texture used for displacement also to Translation map pin:
IMG_5635.jpeg

Then, to make it works, we need to define the "Translation min" and "Translation max" values.

For "Translation min" value, we need to expand the Box Height value, then use a "Binary math operation" node to divide the Box Height by 2:
IMG_5637.jpeg
Then use a "Float merger" node to connect the "Binary math operation" node to the Y pin, and connect the "Float merger" to the Translate min pin:
IMG_5638.jpeg
For the "Translate max" value, we need to use another "Binary math operation" node to add the Displacement Height value to the Box Height divided by 2:
IMG_5639.jpeg
Then use again a "Float merger" node to obtain the Translate max Y value that we need:
IMG_5640.jpeg
And that's it, now the boxes are following the displaced plane surface correctly, and you can change the Box Height or Displacement Height interactively.
IMG_5641.jpeg
The boxes will also follow if you change the displacement texture:
IMG_5642.jpeg
Happy GPU rendering!

ciao,
Beppe
Post Reply

Return to “Tutorials”