Hello Polycount! This is an ocean material that I have been working on for the last few months. It's still a work in progress, so I'm looking forward to some critique on how I can make it look and perform better. Also, I am going to be doing my best to get into the technical stuff while I'm at it. I watched a tutorial on youtube, that helped get me going, and I believe in giving credit where credit is due so here's the tutorial I followed to help me understand how to setup the math portion:
https://www.youtube.com/watch?v=PBWLfpm0K0o
Here is a beauty shot from the shoreline:
Another from the surface:
Wireframe shot:
Translucency has always been a bit of an issue with UE4, I've been told that they have been working on it, nonetheless, I had to do a lot of work to make the lighting look right. The spherical reflection actor makes the lighting look better, but it's hard to get that shimmery reflection that you would expect off the surface of the water. The way to fake shimmery sky reflections is get a cubemap with a similar color palette to your scene, input a reflection vector into it, multiply with a fresnel and put that into your specular.
Seen here:
The water plane is 200,000 polys, or 400,000 triangles. When I first applied the tessellated material to it, ue4 crashed, too many polys...What I did to allow it to run was use a sphere mask to determine the radius around the camera that the plane was tessellated.
Material Setup:
Far away (no tessellation) :
closer(tessellation starts):
Shoreline:
Opacity is controlled with the exponential height fog, because it looks better than just using a depth fade, still, if you don't use depthfade with a customdepth pass, you end up with artifacts, so here is the opacity setup:
shoreline shot:
Gerstner Waves:
Overview of gerstner wave function:
This function is used in a gersnter wave cluster function, where the wave is repeated 8 times.
Here is an overview of the final material:
Overview of mesh:
size of mesh in game units is 787,400 x 787,400. It meets the edge of the atmospheric fog.
Simulation runs at 50fps @ 1080p on a 4gb 760.
Looking forward to hearing what ya'll (I'm from Texas) think of this, and if ya'll have any ideas to make it look better. Thanks in advance.