A less common thing to do is to use a Material to modify an object's position. This is commonly done in things such as water shaders. We do it using the World Position Offset node inside the Material's output.
We can modulate the output position of a vertex using some GPU math. This lightens the load of rendering realistic water on the CPU by a significant amount.
Create a piece of geometry in your world. Construct a new shader called Bob
, which we'll edit to produce a simple bobbing motion for objects rendered with the material.
In your new Material (named
Bob
), right-click and add Texcoord and Time Input nodes.Cascade the sum of the Texcoord (for spatial) and Time Input nodes through a
sin()
function call to create some wavy displacement. Multiply the output of thesin()
function, and pass as Z-inputs to World Displacement.Select...