0
$\begingroup$

This might be weird or totally impossible. I have a subdivided cube which is the ocean. I use cycles node displacement to create waves (have to because the waves require complex node tree) I have a flat plane (technically a disc) where, using textures and several noise nodes plugged into the alpha, i have created foam to be visible where waves and land intersects. The shape and uv of the disc is important, i couldn't simply add the nodes onto the wave / ocean object. There is a discrepancy between the foam and the ocean, because the ocean has waves. I know that i can't shrinkwrap the foam object onto the ocean object because node based displacement is calculated buring render and not actual geometry. But that's essentially what has to happen. Either there's a trick that allows me to do this, or there's some method allowing me to project, as if with a cinema projector, the foam object and it's nodebased alpha channel onto the waves, like a shadow, but white. and keep in mind that there's actual land in there too. Screenshots are obviously simplified with a diffuse shader instead of the nodes: desc waves with node based displacement

desc discrepancy between flat foam and wavy ocean

$\endgroup$
1
$\begingroup$

Syncing displacement textures between two (or more) objects/materials is as easy as mapping to a single object.

First link the texture coordinate of the ocean object to the object itself like so

ocean material

object linking

Then copy the Texture Coordinate, Mapping, texture and Displacement nodes to the material of the foam.

foam material

As long as you keep the Scale values of the mapping, texture and displacement nodes in the foam material the same as the values of their counterparts in the ocean material they should displace identically.

Further, if you need the foam to flatten toward the shore you can just use a colorramped gradient to ease between displaced water and the flat ground.

foam material with displacement fade

$\endgroup$
  • $\begingroup$ There are issues, but i think this is going to work $\endgroup$ – Walter Sep 27 at 20:23
  • $\begingroup$ What issues are you having? I may be able to amend my answer to help you. $\endgroup$ – TechTornado Sep 27 at 21:48
  • $\begingroup$ Solved it. Works perfectly. Had to apply scale of foam, flip the normals and put both faces at exactly the same z height $\endgroup$ – Walter Sep 28 at 15:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.