How are you varying the “look” of the waves over time in this project? I’m asking because I actually wrote my Bachelor degrees in realtime water simulation using Unreal Engine and in the case of Gerstner waves you can’t change the parameters of the waves while their live time. So you basically have to change the parameters for every new wave if you want to avoid a repetitive pattern of waves. Maybe you want to answer this and if so, is your way of doing this still performant compared to like using Fast-Fourier-Transform?
I know it’s a big question but water in video games is just one of my most favourite things and I like how people from the community are trying to expand the engine’s missing parts. Keep it up guys!
Physical Ocean Surface can be used in different ways. You can just use the included water material, but you can also use it to improve an existing water material. Here is an example how this can work.
The VehicleGame example (available for free in the Launcher) comes with a water shader. Let’s try to improve this shader with Physical Ocean Surface.
First, here is a video of the shader that is included in VehicleGame:
Now, to create an improved water material we merge the VehicleGame water shader with the Physical Ocean Surface water shader. At the “Normal” and “World Position Offset” inputs we connect the the Physical Ocean Surface material nodes, at the other inputs (BaseColor, Metallic, Roughness) we use thte material nodes from the VehicleGame water material. Here is a video the result:
I’m planning to use this as an example in my documentation, you will get detailed instructions how to merge Physical Ocean Surface with an existing water material.
I’ve just received confirmation from Epic that my water shader was accepted to the Marketplace and will be available soon. The name will be changed to “Physical Water Surface” to emphasize that it also works for smaller water surfaces like lakes, not just large oceans. I don’t know the release date yet, but I will keep you posted once I know more.
It’s on my list of possible features. I haven’t tried to develop a mobile variant yet but I think it will be possible, probably with a reduced number of Gerstner waves.
Hello there. I have to say, your work is very impressive. Certain features of it, particularly the wave physics and the texture, appear more realistic than even Nvidia waveworks. If you don’t have a particular use for the shader, would you mind posting a tutorial on how exactly you accomplished this?
You can change material parameters while the game is running, so I’m not exactly sure what you mean. At the moment I don’t do this in my shader, but it would be possible.
It would be actually challenging to modify my shader to get a repetitive pattern, all the wavelenghts would need to be multiples of each other. If the’re not and you’re summing up enough Gernstner Waves, the water does not look repetitive.
I didn’t try the fft approach, so I can’t compare the performance. But I’m summing up a lot of Gerstner Waves, and the performance is good enough.
Yes it’s possible to get rid of these. They are not part of the Gerstner equations, they’re an additional normal map that is added on top. Just open the WaterInstanceShiny Material Instance and change the DetailNormalStrength parameter. If you set this parameter to zero, the “noise” will disappear and the water surface will be smooth like in this video https://gfycat.com/SnivelingDeliciousAnteater.
How do I remove these? How can I make the ocean appear more natural?
The first issue appears to be u/v related and is quite noticeable in the still image. The second issue still image doesn’t do it justice. The shimmering is extremely pixelated during runtime.