mathematical formula to Shaders

Hello !

I’m trying to create my own Ocean shader based on physical movement but i don’t even know how can I translate it. i try to find solution my I give up after many ours. You’re my only chance ^^

Like this link or many else : Dynamic physical ocean - Work in Progress - Unreal Engine Forums

http://img15.hostingpics.net/pics/628863013equ01.jpg

http://img15.hostingpics.net/pics/938563fig0105.jpg

In this one, i don’t understand what could be the direction id i can’t get it with normal map for exemple, thank you !
Thank you very much !

Usually you need a bit more context before deconstructing a formula like that. Those giant crooked E like symbols are basically forloops and the i subscript would probably be like the previous value of some variable. But without seeing the rest of the math I don’t think I can just figure it out. I suggest starting with something a bit simpler or a paper that actually describes how everything was derived at, like this:

http://www.limsater.com/files/ocean.pdf

edit found what you are looking for. This technique is called Gerstner waves. I wouldn’t really recommend this project for somebody who is just learning how to translate math to shaders as this is one of the more difficult topics to start with.

http://http.developer.nvidia.com/GPUGems/gpugems_ch01.html

They explain what every variable such as w and D do… the variable Q looks to be a steepness parameter for you to tweak… thats about as far into it as I have time to go atm.

Hey ! Thank you again ! :slight_smile:

I found this one : Gerstner Wave Normals - Rendering - Unreal Engine Forums

but when I try to put it in a custom node, it doesn’t work

http://img11.hostingpics.net/pics/325270Untitled1.jpg

thank you

Your wave direction and world position are constant zero. That is invalid input.

You also forgot to hook up wave_steepness and wave_amplitude.

For fixing errors in the custom node, I suggest you open up consolevariables.ini (engine/config) and uncomment the line that says “shaderdevelopementmode 1”. That will give you more specific information about what the compiler saw and didn’t like such as line number. Could be the lack of above variables or some small syntax error.