The ocean

I captured two clips in the end of the ocean I delivered for my assignment, one has a couple of tall rocks in it and the second is a beach type environment.

Clip 1

Clip 2

Where did I start?

First of all, they were made using UnrealEngine4, which honestly is fantastically versatile. I’ve been using it more and more ever since getting comfortable with it this summer. I initially set out to adapt a method we were taught for 3ds Max; it used a randomly generated noise map, mixed with a smoke map turned into a height displacement. You may have seen the result (with particles emitted from the peaks) in my other posts about procedural ocean and procedural animation . It did not look good. That was in part due to no real material being applied to the animated plane, in part terrible particles and in part just… urgh… how did it look so awful!?

Right, so, with that firmly out of my mind again, I set about trying out a few things in engine, like making some physics volumes and putting together a quick landscape. I realised that there was no “quick and easy” for the displacement map unless I wanted to use something pre-rendered. While our teacher probably wouldn’t be able to know the difference from a render, it just seemed like a good way to ruin a fun challenge. At this point I soaked myself in tutorials and trial and error.

capture1
Plane in landscape, no material

First iteration of water, it has no movement, and no material. Ok so it’s not water, it’s just a flat plane. A really flat plane. But! It also has a physics volume which meant a player can swim in it, and it has a post processing volume that makes the world blue when you are inside it.

capture2
Initial Water material with colour based on depth.

At this point I created a material which fades from dark blue through some lighter blue shades and into almost white with multiple depth fade nodes. The nodes blend 2 inputs together at a specific depth, in this case dark blue for the majority, and then other colours at really shallow depths. Later on when the material gets animated, it means that as waves approach the shore they get gradually lighter, until they wash out as white on the shore.

capture3
Water material with reflection, looks super pretty

Added some other properties to the water, and got a really serene looking water surface. All quiet and inanimate, ready to be ruined by terrible ideas.

capture4
Totally break reflections as I begin with attempts to animate

Here I have some movement, in the wrong direction, with some stupid looking waves that were moving totally wrong and way too fast. Oh and they broke my pretty depth fade,  and my reflections. Bugger!

capture5
Getting the waves into the material, too “clean”

At this point, we have some slightly derp looking waves, that go in a completely symmetrical and regular intervals. Something you would get in a wave pool, but not in an ocean. Honestly, it took a lot of work to do those waves though, I found a tutorial about simulating waves, and watched it on and off for several hours until I understood how it worked and why. Using various speed, height and time parameters fed into a sin node, to make an animated sine wave displacement map. The above pic has two of these sine waves, with slightly different directions, multiplied to get a slightly more interesting effect than just one sine wave.

6pp2ng9
hey presto! animated waveses, still need plenty of work 😦

This is the final form of my ocean, waves washing onto beach. I gave them a slightly foamy noise map at the very shallowest. I wanted to work more on the material, and make far more complex waves, but realistically I didn’t have time for that. I left the material open for variables like wave height, wind direction, wave intensity. Those variables could for example be modified by a blueprint in realtime for a game where the wind changes the direction of the waves.

The way I see it, it is entirely possible to make some really satisfying procedural generated water animations. However, since good water is made out of several complex elements, it seems like a waste of resources procedurally generating them all realtime. I think in the future I am far more likely to render out some procedurally generated maps, and blending between them for interesting effects.

I should try to use the same way as we did in 3dsMax, using a panning noise map, lets see how that pans out!

 

 

Advertisements