Ocean shader directly into texture without baking?

Only this one looks kind of neat:

But that would require using open shading language and programming this (quite elaborative)
Will look a bit further too.

But no way to program it directly? The ocean modifier looks so realistic, because the it uses actual wave spectra as we measure them in real-life. It also generates a texture, so it must be possible to use as direct input…?

The modifier is generating textures but as an addition to geometry displacement in viewport.
The interest of a displacement in viewport is to set an interaction with other objects.

Generally, an ocean is not rendered alone. It is rendered with characters : boats, submarines and swimmers, one giant wave (higher than the others).
And those objects are deforming the displacement.
So, the idea of using a modifier is that other modifiers will be added after it, in modifier stack.

Ocean modifier is an old modifier made for 2.4x series, more than a decade ago.
Nowadays, that would make sense to create a texture node usable by geometry nodes and shaders.

Feature request next version?

Just an empiric method. i’ m not a scientist at all. but here is my vision as a guy coming from a fisherman family in the western part of france:

Lets build a wave displacement shader.
assuming we have got a 15 meter boat on a 400*400 meter ocean.
due to the huge scale… we gonna scale the plane to avoid impossible values in shader editor.
we gonna use object coordinate system for mapping then the procedural shader “wave” will have a scale inheritance from it.
Ocean is maid of crossing waves of different “size” moving at different speed regarding the flux force.
Let’s call that under waves and over it there is some wind effect.
we gonna focus first on “houle” (under waves)

with that we gonna make a group to be able to mix displacement vectors to add more than one wave direction.

To be continued…



It’s essential that you model and share your family’s fishing boat now :grin:

1 Like

To avoid resource consuming displacement with cycle for nothing, let’s reproduce the big wave’s shader in geometry node. By this, we’ ll be also able to stick the boat over the ocean surface.
you can notice that the wave’s scale is very strong. the boat cannot fish, it’s too dangerous. the captain decide to navigate “à la cape”.
so we must play with the noise scale to avoid everybody’s death onboard.

then again, we create a group to duplicate and orientate more waves.


Next we ll get ride off the big wave’s displacement in the shader and focus on the wind effect over the surface.

to be continued…


Cool to follow your progress, @skuax
Looking forward to your folow-ups.

1 Like

I’d rather thought of a challenge of Geometry Nodes lovers.
As you can see, @skuax started.

But there are a lot of settings in Ocean modifier.
Depth of ocean and smallest wave setting are there, because generated waves don’t have same size.
Choppiness of wave, speed of wind and spectrum can make them more or less frightening.
And Foam is generated only on a part of waves.
That are a lot of variations that is making it more realistic.

So, if several Geometry Nodes experts give it a try, they could determine what is currently missing in Geometry Nodes to reproduce modifier.
That way, developers would have to spend time and to figure it out.
They would have minimal work to port it to Geometry Nodes.

If pattern generated by Ocean modifier was available as a 4D procedural texture in Geometry Nodes, and if another node was created for such specific displacement, user would not have to set-up several dozen of nodes.
I am wondering if a kind special displacement node could be created to generate landscapes and oceans, too.


Amazing work!! Very cool to be able to get this far with geometry nodes / shader nodes.

Some addition of wave theory to make it more realistic. These are all so-called “first-order” Navier-Stokes waves: basically a normal sine function. When water gets more shallow (the depth parameter) or when the waves get longer (swell, less steep → steepness parameter), some harmonics will come into play, creating second-order and sometimes even third and fourth order waves. This will make them steeper as well.

Water Waves 2014 | A blog on the water waves programme at the Newton Institute in summer 2014, Managing Editor: T Bridges, Editorial Advisory Board: M Groves, P Milewski, D Nicholls | Page 8

You can see that effect in this picture of very nice swell waves:

Not sure though about when and how to add foam… Foam is usually only generated when the wind has a force of approx ~5/6 bft, so above ~10 m/s.


One small question: can geometry nodes be used in combination with adaptive subsampling?

I guess I’ll try first :stuck_out_tongue:

Okay so that’s not possible (making it a bit difficult for infinite oceans). So let my try this in terms of just shader nodes.

First question: why are the waves in the wave texture not linear? Why are they skewed? How can we get them linear?

The mesh is displaced in 3 values X Y Z if you use a vector displacement.
To tweak it use a vector map range node.

It will be useful later to push the wave crest a little bit more in the wind direction for example

1 Like

I’m on my journey on the ocean.
I’ll try to incorporate the maximum stuff i can inside.
i don’t really know where i’ m going. But i 'll try to do my best to incorporate as much thing as possible without making it to heavy…
I use Eevee to tweak the animation and roughly put shading etc…
then after… i ll switch to cycle…
there is a lot to do, and any advises like yours and from the others ll be welcome.



The foam could be generated by getting the wave’s height with a mask. and can be also used for particle generation.

I also tried to put something together, but then in shader nodes.

Seems like I have a nice base:

With the group:

Group input has wave length in terms of blender units (1m, so 100 as input is 100m wavelenght). Wave height is wave height, etc. You can include a factor for second order and third order harmonics (0.5 and 0.25 by default)

Thing though is, to make a proper realistic sea, you’d have to multiply waves on top of eachother in a bunch of different directions, probably like 10-20 times, the more the better.

Actual oceans make use of a so-called “wave spectrum”: a summation of many smaller sinuses. That’s what gets the nice random look.


Then for animation, the waves also have different speeds, depending on there wavelength. This is what you also see in real life: wave catching up on eachother, suddenly splitting up, etc.


All of this can be programmed in geometry nodes / shader nodes of course, but it will take a lot of nodes. This all is implemented in the ocean modifier by default.


Another interesting approach at OceanNodes I see.

How does this look?


Okay so I added 15 of those wave shaders including the propagation speed with a bunch of different directions into a shader.

How does this look? It took about 20 seconds per frame to render.

Any recommendations for improvements?

I’ll share it later once it’s finished.


Any suggestions for foam?

Just adding a white layer on values for z above certain threshold is downright ugly :stuck_out_tongue:

1 Like

Hi @maschoemaker

I have been following this thread, and was going to suggest Fractal Voronoi noise, as it looks like it is coming to Blender soon, and would maybe give a ‘slightly less nodes’ solution to an ocean shader.

Yesterday?? A thread popped up from the developer of Fractal Voronoi noise to ask for some ‘real world’ examples as it seems the devs are in two minds as to wether to include it in master,

I cannot seem to find that thread now,

Thread on devtalk.

Maybe somebody else saw this on BA too?

Edit, it was flagged as Spam!

Heres the thread.

Oh nice! I think a combination would be great. The vonoroi noise doesn’t seem to have directionality, but adding it to a “base wave” would make a great stormy look, since it is nice and sharp. With this method, I can only generate nice regular waves that look like sinusses.

White capping / foam occurs when the peaks are getting very sharp, like the image below:

This is impossible to generate with only sinusses that are added on top of eachother, hence I don’t think we’re able to get good looking foam (yet) with the shader as I’ve currently defined it…

I have added the ocean modifier as texture in shader/geometry nodes as Blender feature request: