Creating realistic waving water?

is what i want to createhttps://youtube/watch?v=Kn5G1yA0F8o
And i don’t mean i want to recreate Halo 3’s water, i want to create water that acts somewhat like that. Small and realistic looking waves.

I can’t find ANY tutorials anywhere, does anybody know what the technique is to create water like that?

Check out Water planes in Learn tab of Launcher and thread

Also make sure to check tutorial: :slight_smile:

Not that didn’t do a good job mentioning it, I just feel should get more of a bigger mention. :slight_smile:

In the Learn Tab of the Launcher you have the option to download a project made by Alan Williard (Developer Relations Technical Artist here at Epic) as a learning example:

example has three types of water available and a lot of customization. Oh yeah, and it’s FREEE! :smiley:

If you’re unsure about it you can check out the video demonstrations here:

?v=aJ1M0Ejd_ts

Wow community rocks! Thank you!!

Is there a way to animate water surface by using displacement maps?

What i mean is, that for example i run blender’s ocean simulator, and then bake the simulation on to displacement textures.

Is there then a way to cause animated tessellation with them in unreal engine? I feel like that would come off as some really realistic and beautiful results!

You can use a panner/sine node to move your displacement texture -> just connect it with the uv from the texture sample :slight_smile:

I don’t mean to move one texture, but to play bunch of displacement textures repeatedly. If my simulation would go 30fps in blender, and i bake every frame on a displacement texture, is it possible to play it back as a tessellation in unreal engine?

You could use the flip book material function to sort of play a movie from you’re textures if that is what you want. But it is more performance friendly to just render 3-6 displacement textures and move those around using a panner or similar. I believe that in Assassins Creed: Black Flag they used 4 pre-computed wave height maps. There is also a material function somewhere in the engine called something like 4waychaos which is an easy way to move a single texture around in four different directions. The chaos function would be useful to for example move one detail texture around on the surface easily.

Also! I believe that the water in halo 3 was created using gerstner waves on the fly (in a shader). Nvidia has great chapter on these kinds of wave here: ://.developer.nvidia/GPUGems/gpugems_ch01.html.

If you want to get really advanced there is paper written by Jerry Tessendorf that explains how you could do statistical ocean simulations using FFTs ( is what the used in AC:BF as a mentioned in the previous post). article also touches on how you could do the actual shading of the surface, like inscattering and attenuation. Link: ://graphics.ucsd.edu/courses/rendering/2005/jdewall/tessendorf.pdf.

On the topic of shading crytek held a presentation at gdc 2007 where they showed some atmospheric including river shading which might be interesting for you! You can download the presentation slides here: ://www.crytek/cryengine/presentations/real-time-atmospheric–in-games-revisited

Heres a link to an article discussing the water simulation and shading used in AC:BF. ://www.fxguide/featured/assassins-creed-iii-the-tech-behind-or-beneath-the-action/

Thanks guys! I managed to get a pretty cool result with only one displacement map and normal map baked in blender, and it looks like with a freeze frame:

The wave animation looks very cool in my opinion. But I’m still struggling to get a nice, shiny oceanish shader for it. For now the material looks very bad. For some reason, i can’t get a translucent shader look shiny. Also if i use two sided material, it looks REALLY BUGGY.

In version 4.8 there will be SSR for translucency, but as it stands currently it is really difficult to get the right look. I have tested 4.8 out (latest build from GitHub) and the SSR adds a lot to the scene, but it is not the full solution. Make sure you have a Skylight in your scene to get some specular highlights, but full reflection is not available at time.

I am also working on an ocean shader, it uses Gerstner waves along with some extra displacement maps to get a fairly realistic looking ocean surface. It has controls for adjusting just about anything through the blueprint, still needs some more work but it’s getting better.

One you may come across is when the camera is right down at the surface you will notice some pretty extreme artifacting issues where a wave is being rendered behind another wave, causing black or invisible sections of the surface to appear. To fix you will need to render 2 separate meshes, one with your translucent material and the another new opaque material with the displacement only connected. Then set the opaque material/mesh so “Render in main pass” is Off, and turn on “Render Custom Depth”. So all that mesh is doing is providing data that can be used through a SceneTexture:CustomDepth node to prevent any translucent sorting issues that come up.

Here is the thread I created due to the artifacts appearing on the waves, it was a while ago but the info is still relevant, TheBeej’s answer has all the info:
https://forums.unrealengine/showthread.php?45945-Translucent-Water-Material-Displacement-Banding-Issue

Feel free to download my project (link below) from the other thread to see how I got around that part, or if you need more info (which is likely, isn’t very straightforward ;)) let me know.

Here is the link to download the project - https://drive.google/file/d/0B3u_RPl4K60ibkE2Tm5VaVFyczA/view?usp=sharing
Here is a link to the thread with more details - https://forums.unrealengine/showthread.php?42092-Community-Project-WIP-Weather-amp-Ocean-Water-Shader

Hope that helps! :slight_smile:

Thanks i will check them out once i have time! Having really busy week now…

I got an idea from your post. I managed to get really good looking ocean shader with opaque material, but it look unrealistic because its not a see-through. Is it possible to mix two shaders in UE4, opaque and translucent materials together? way it would be possible to get a great shiny look and also see the bottom. What i mean is, is a Blender like “mix shader”. I know there is no mix shader where i could mix diffuse and glossy materials together. Still is it possible to use 2 meshes with one being opaque and other being translucent, and show 50/50 of both of them?