Objects follow water

Started by Dune, January 04, 2023, 08:26:47 AM

Previous topic - Next topic

Dune

The title reflects my thoughts after making this WIP. I added a population of waterplants, which should float. They do, but they won't follow waves very acurately. I can of course delete the 'wrong' instances, but maybe there's another solution. So I was thinking; would a mesh displacer using the waves as displacement input bend the object enough so it would follow those waves? As a population? I know the mesh should be fine enough. Worth a try.
Another option would be to use a texture with alpha, but then you easily get repetition, as the image map won't rotate randomly as instances do.

Btw. I'm not yet satisfied with the sandy 'cliff', or the lighting.

Hannes

So, if you want just flat leaves on the water following the curvature of the displacement, you could just duplicate the water plane, lift it up a few millimeters, texture and mask it with some textures, maybe even procedural (fake stones?). Just a thought. I don't know, if that would be sufficient enough for you.

Dune

I have a procedural 'lily pad and flower' setup, but that's only good for distance. And it won't need a duplicate plane, but can be masked projected onto the water sphere/plane, and offset half a millimeter. Perhaps a big enough image with alpha as mask would work better.

Hannes

Worth a try I guess. Looking forward to your next step.

WAS

#4
Warping by wave displacement will work for individually placed objects, but not a population, as that feature isn't added yet to apply to individual objects with final position map. It'll just apply the same displacement to each pop

My personal suggestion

  • Wave without micro displacement -> Compute Normal/Terrain (Use Smooth Surface to smooth out hard voronoi looking peaks)
    • Could just use perlin and skip all that but not sure how convincing it would be for wave features
  • Add micro displacement
  • Masked surface layer with leaf rig, using Smooth Surface

The idea being where the leaves are masked into the water, the area will be smooth, but conform to the wave shape, and allow leaf texture/bump appled without water micro displacement, or hard creases interfering. 

WAS

#5
Leaf Litter A
Leaf_Litter_A.jpg
Leaf_Litter_A.tgd

I was going to do a B but unfortunately there is no displacement mode for planes, cards, spheres, etc, that works with opacity. You get black. And glass trick is so slow with volume seen through it that it's just not worth it (and not sure if it even works).

If you use like 4 individual leaves and rotate mix with masks you could get a nice mix of leaves all sorts of angles. I'd probably use a hard mask and influence color so it could look like some leaves are just ripped/broken.

Dune

#6
Quote from: WAS on January 04, 2023, 04:46:21 PMwill work for individually placed objects, but not a population
Thanks for your idea, Jordan. We're actually on the same line of thought, as I also remembered vaguely pops' mesh displacement wouldn't work, only per instance/object.

The waves are already perlin, as the water waves aren't very natural on a small, not very windy creek like this. I would have done it more or less the same way as you describe, but adding a XYZ shader after the first smooth waves to fix those, before adding micro displacement and the smoothed, masked leaves. No compute needed. Otherwise the first waves will be smoothed all the way down by the surface layers smoothing.

Dune

Another example, slightly different. Getting a decent overall mask is a bit difficult, as you soon end up with fading out texture, but the bias helps break it up. Another way would be to use the distort by normal just a wee bit.

Hannes

Wow, that's quite a setup!!! Anyway, looks great so far.

Dune

It's pretty basic, but it would still be best for a bit of distance (so I ended up not using it my stream scene). But then you more easily get repetition. I actually rendered 2 pops of different objects with an ortho cam and 90ยบ sun, while uncheking render atmo and surface, and made an alpha channel in PS.

Btw. the bias could probably have been taken from the merge shader directly.

Hannes

Cool! Probably the easiest solution.

mhaze