Why are my ocean shader waves not displacing correctly?

Greetings everyone, I am currently creating a stylized ocean Shader, I want a full ocean shader with waves, caustics etc, but still want it to look quite painted. Currently I am working on the waves. I currently am using a sine wave texture to plug into my world position offset, using a 3 vector (z).

Right now, it’s not working as intended, the mesh is distorting from the X not the Y, which is causing the water to now be dynamic, but the waves to be 100% flat. Please any assistance would be greatly appreciated. We can sit together on Discord and look over the shader. I am new to Unreal engine. While I have learnt a lot in these last two weeks, with this, I don’t quite know where to start to figure out why it’s not using the sine wave correctly.

Any help is greatly appreciated community. :slight_smile: Thank you!


Graphic is too small to read but regardless you are using it wrong.

If you want only Z to displace, then isolate (mask) just the Z.

At that point, the vectors will go up and down depending on how you set things up, which is all wrong so ill just give you an example:

Texture - single channel - multiply VertexNormal - multiply scalar variable defining the height.
(Then make the UVs pan as you wish).
This will work regardless of your angle of the ocean, but it assumes your nromals are set vertically.
More costly alternative, same thing but mask WPO > mask G in the multiply instead of vertex normal.

That should get you going.