Ocean modifier as texture in shader & geometry nodes
The ocean modifier is modifier that generates a texture that displaces the geometry. Two textures are generated: a normal map and a foam layer:
To generate i.e. an infinite ocean that doesn’t repeat itself and looks good everywhere, in theory, you can stack different ocean modifiers on top of eachother and then apply them to one extremely large subdivided square/cirkel. Unfortuntaly, this is impossible because this would lead to way too many vertices that are being used. Optimizing the amount of vertices for your scene is very labour intensive and time consuming.
Instead, you would like to use the adaptive subdivision modifier to limit the amount of vertices and keep them realistic within a scene. However, it cannot be used in combination with the ocean modifier. To overcome this, you’d have to bake the different ocean layers out and set up a shader that loads them and use that as displacement texture, on which adaptive subdivision does work. This is labour intensive work and requires insane amount of disk space (especially for longer scene animations) to get good looking oceans.
Since the ocean modifier generates the textures itself, would it not be an idea to be able to directly load the texture into the shader and then use that to displace the ocean geometry? This will make it easy, quick, very controllable, more versatile and save huge amounts of data since baking is not required anymore. Creating infinite oceans for scenes changes from hours of work and gigabytes of data to mere minutes of work.
Also, this would have the added benefit of getting a higher resolution foam on a lower resolution displacement texture. Currently, they are generated at the same detail. This limits the crispness and sharpness of the foam, especially when closer to the water. The limits are generally created by the amount of vertices that can be displaced and the resolution the displacement texture can be generated. The foam would require a higher resolution to result in a sharper image.
3 Comments
I have plans for do this, but not yet
Nice!!
I tried making it myself, but I can't get nice foam and breaking waves. Only nice round waves. blenderartists.org/t/ocean-shader-directly-into-texture-without-baking/1447605/21 Would be nice if it is the ocean modifier directly as it supports so much more. I think a lot of people will use it.
In result this will be node group\