I baked the ocean modifier for all frames and added them as a vector displacement maps, using adaptive subdivision to make the displacement.
As for the next step, I would like to make the waves on the edges of the lake smaller. In real-life, the largest waves are always in the middle and they are much smaller near the lakefront, or even absent.
So I thought that using the Ambient Occlusion node would work as a mask to scale the waves. This is a perfect mask. Black means absent waves and then it transitions to white where the waves are full scale.
But I can’t seem to get it working… Whatever I do, whatever node setup I use, the ambient occlusion map does not influence the displacement generated by the ocean modifier.
I’ve tried (edit) three approaches:
Adjusting generated displacement vector by multiplying it with the AO map. In theory this should work near the shoreline, a value of 0 is generated for no waves and a value of 1 is generated in the middle of the lake. However, it does not influence the wave height at all…
The ambient occlusion node works a bit different from the rest of the material nodes. It’s a complex, multi-sample effect that gets calculated at the same time as the material. Maybe it would react different if you baked the AO to a texture?
I guess it works the same for that script I found. Both use the raytracing samples as input, which means it’s done after the displacement is calculated. Hence, it does not influence the displacement map…
It does work if I add a wave texture, but of course that’s not the solution, but just checking Blender isn’t broken or something
I will try to bake it out next (though the scene is 1x1km large…), but it would be best of course if it’s possible to make it in a procedural manner using nodes, so you can reuse it for new scenes.
If you have it UV unwrapped, you can combine two linear gradients with multiply to get a darker area near the middle of the plane and lighter along the edges, but it won’t follow the curvature super well what if you used geometry nodes to get the proximity of the water to the banks, put that in a custom property or attribute, and used that in your dander nodes?
You can use the Geometry Proximity node and the Map Range node to calculate the distance, and store it in an attribute. Then, you can use the attribute to mask the vector displacement map, so that the wave height is zero around the edges.