# WaveWorks Infinite Ocean Planes

**URL:** <https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226>\
**Category:** Game Development\
**Tags:** unreal-engine\
**Created:** [October 20, 2015, 3:42pm UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226 "2015-10-20T15:42:40Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_bcf66e2c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bcf66e2c](https://forums.unrealengine.com/u/anonymous_user_bcf66e2c)\
**Post date:** [October 20, 2015, 3:42pm UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/1 "2015-10-20T15:42:40Z")

</div>

I figured I would post this here as well. I have implemented the integration that allows for using the WaveWorks Quadtree generator to create infinite oceans. This is still very much a Work in Progress, it can still be a little crash happy when trying to set it up, but after that it runs quite fine. Could still be optimized some more. There are a few caveats to using it:

- Does not work with Static Lighting, causes discoloration and other artifacts, so make sure to turn off precomputed lighting in the World Settings, and run a Light Build at least once.

- Shadows casted onto the water surface look very abnormal in the editor, but appear fine in game.

- Only works with opaque materials at the moment, dont even know what will happen with a translucent material.

- Only flat tessellation, trying to use PN Triangles will result in incorrect behavior

- Only supported on SM5 at the moment.

Take a look at the sample project provided on how to set it up, but basically you:

1. Create a new WaveWorks asset and configure

2. Create a new material, use the WaveWorks node to set the Normals and Displacement (Only Flat Tessellation is supported - But it does not really use flat tessellation either, it has its own tessellation and crack fixing code). Dont feed anything in Tessellation Multiplier, it has its own calculation for that.

3. Create a new Blueprint Actor and add a WaveWorksComponent, then assign the material from above, this should then create the quad tree. \<– This is where it can crash. If it does, just restart and try again.

4. Drop the actor into the scene, doesn’t matter where, it is infinite in all directions, to adjust the height, adjust the Sea Level variable in the WaveWorksComponent.

?v=BRkt\_-FpRUA

Next on the plans are:

- Implement Alloc/Free patch for controlling which patches are visible, good for hiding water that is permanently covered by terrain.
- Implement a single patch feature so you can have small areas of water, would be just a configurable plane.
- Bouyancy and displacement readback
- OGL and DX10 support (Using geo-morphing instead of tessellation for DX10)

If anyone has any features they would like to see, let me know.

I would like to give a big thanks and a shout out here aswell to Temaran for his work on the RenderDoc plugin for UE4, this saved me some hassles on figuring out some unknown variables needed for the integration. If your doing shader development of any kind, you should go grab it here: [https://wiki.unrealengine/RenderDoc\_plugin](https://wiki.unrealengine/RenderDoc_plugin)

---

<div class="post-metadata">

**Author:** ![n00854180t](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@n00854180t](https://forums.unrealengine.com/u/n00854180t)\
**Post date:** [October 20, 2015, 4:57pm UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/2 "2015-10-20T16:57:02Z")

</div>

Gorgeous! Awesome work !

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5cee3492](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5cee3492](https://forums.unrealengine.com/u/anonymous_user_5cee3492)\
**Post date:** [October 20, 2015, 5:51pm UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/3 "2015-10-20T17:51:29Z")

</div>

Thanks! How do you create the wavework component? I don’t have it in the BP editor.

---

<div class="post-metadata">

**Author:** ![TK-Master](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TK-Master](https://forums.unrealengine.com/u/TK-Master)\
**Post date:** [October 20, 2015, 6:34pm UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/4 "2015-10-20T18:34:34Z")

</div>

> [@;403560](#):
>
> Next on the plans are:  
> …
> 
> - Bouyancy and displacement readback

I have been trying to read the displacement for ages, I will definitely be keeping an eye out for that!  
Then I could adapt the community ocean project’s shader to work with WaveWorks, should be interesting 😛

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_923c79df](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_923c79df](https://forums.unrealengine.com/u/anonymous_user_923c79df)\
**Post date:** [October 20, 2015, 6:34pm UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/5 "2015-10-20T18:34:48Z")

</div>

That’s awesome!! 😃

> [@](#):
>
> Thanks! How do you create the wavework component? I don’t have it in the BP editor.

I think he uses the gameworks plugin from nvidia

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5cee3492](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5cee3492](https://forums.unrealengine.com/u/anonymous_user_5cee3492)\
**Post date:** [October 20, 2015, 6:49pm UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/6 "2015-10-20T18:49:19Z")

</div>

There’s a GameWork plugin now? I used 4.9 engine modified to include nvidia gamework stuff (waveworks+flex+hbao++vxgi)/

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_923c79df](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_923c79df](https://forums.unrealengine.com/u/anonymous_user_923c79df)\
**Post date:** [October 20, 2015, 7:35pm UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/7 "2015-10-20T19:35:34Z")

</div>

> [@vinz243;403716](#):
>
> There’s a GameWork plugin now? I used 4.9 engine modified to include nvidia gamework stuff (waveworks+flex+hbao++vxgi)/

No, there is no plugin (as far as I know), I meant the modified engine 😃

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_bcf66e2c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bcf66e2c](https://forums.unrealengine.com/u/anonymous_user_bcf66e2c)\
**Post date:** [October 21, 2015, 12:45am UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/8 "2015-10-21T00:45:40Z")

</div>

> [@vinz243;403716](#):
>
> There’s a GameWork plugin now? I used 4.9 engine modified to include nvidia gamework stuff (waveworks+flex+hbao++vxgi)/

You need my latest changes, i only committed the code last night, once u have that, u should see a Wave Works component in the list of Components in a Blueprint Actor

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_bcf66e2c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bcf66e2c](https://forums.unrealengine.com/u/anonymous_user_bcf66e2c)\
**Post date:** [October 21, 2015, 5:26am UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/9 "2015-10-21T05:26:11Z")

</div>

SM4 support for WaveWorks has been committed, also fixed a bug with Turbulence that allows for SM4 packaging. This does not mean all the GameWorks techs work in SM4, only WaveWorks does, but you can package the entire project for SM4 just make sure to disable the other techs ingame somehow.

It will use geomorphing instead of tessellation, so you need to update your material and have it pass the WaveWorks Displacement pin to the World Position Offset output instead of displacement. Refer to the sample project, where I use a FeatureLevelSwitch to swap which output is used based on feature level.

OGL support is going to be a long while away, a bunch of other shaders for the other GameWorks techs need to be modified to at least be compilable in GLSL

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5cee3492](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5cee3492](https://forums.unrealengine.com/u/anonymous_user_5cee3492)\
**Post date:** [October 21, 2015, 10:10am UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/10 "2015-10-21T10:10:44Z")

</div>

> [@;403963](#):
>
> You need my latest changes, i only committed the code last night, once u have that, u should see a Wave Works component in the list of Components in a Blueprint Actor

Thanks! I’ll try to see if your changes can be merged in our modified engine!

Is it possible to make wind blows to a point rather than a direction (so if you’re making an island for example)?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_bcf66e2c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bcf66e2c](https://forums.unrealengine.com/u/anonymous_user_bcf66e2c)\
**Post date:** [October 21, 2015, 10:33am UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/11 "2015-10-21T10:33:25Z")

</div>

> [@vinz243;404183](#):
>
> Is it possible to make wind blows to a point rather than a direction (so if you’re making an island for example)?

Not that I am aware of, WaveWorks only takes a direction.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5cee3492](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5cee3492](https://forums.unrealengine.com/u/anonymous_user_5cee3492)\
**Post date:** [October 21, 2015, 10:51am UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/12 "2015-10-21T10:51:53Z")

</div>

A pity. And what about collison with landscape?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_bcf66e2c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bcf66e2c](https://forums.unrealengine.com/u/anonymous_user_bcf66e2c)\
**Post date:** [October 21, 2015, 10:58am UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/13 "2015-10-21T10:58:39Z")

</div>

> [@vinz243;404193](#):
>
> A pity. And what about collison with landscape?

WaveWorks purely is a visual thing, it provides no collision data. Even for buoyancy, all I get is the current displacement values so I can implement some kind of buoyancy myself. So you’ll have to handle any kind of interaction with the environment.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_bcf66e2c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bcf66e2c](https://forums.unrealengine.com/u/anonymous_user_bcf66e2c)\
**Post date:** [October 22, 2015, 11:48am UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/14 "2015-10-22T11:48:37Z")

</div>

Well I got displacement readback going, and implemented a quick and dirty buoyancy test, turns out, haven’t got a clue on how to setup actual buoyancy, so will leave that for others to implement if they feel like it.

To read back samples, there is a new function on the WaveWorks Component - SampleDisplacements. Feed it in a list of sample points in World Position as a Vector2D, and it will return a Vector4 containing the displacement for that point.

Code will be committed shortly.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5cee3492](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5cee3492](https://forums.unrealengine.com/u/anonymous_user_5cee3492)\
**Post date:** [October 22, 2015, 11:54am UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/15 "2015-10-22T11:54:08Z")

</div>

Awesome work dude!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5cee3492](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5cee3492](https://forums.unrealengine.com/u/anonymous_user_5cee3492)\
**Post date:** [October 22, 2015, 4:39pm UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/16 "2015-10-22T16:39:14Z")

</div>

Hey, I just merged your latest stuff, with the WaveWork component. The infinite ocean is realy great, however it is tiling too much.  
://i.imgur/r4xRfvqm.jpg  
://i.imgur/XTCwj2km.jpg

Also, regular plane won’t work

Any idea why? Thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_bcf66e2c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bcf66e2c](https://forums.unrealengine.com/u/anonymous_user_bcf66e2c)\
**Post date:** [October 23, 2015, 12:22am UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/17 "2015-10-23T00:22:11Z")

</div>

> [@vinz243;405174](#):
>
> Hey, I just merged your latest stuff, with the WaveWork component. The infinite ocean is realy great, however it is tiling too much.  
> Also, regular plane won’t work
> 
> Any idea why? Thanks in advance 🙂

In The WaveWorks asset, play with the FFT size, larger numbers should result in less visible tiling. And regular planes won’t work as the new implementation of WaveWorks has a very specific shader implementation, I will be implementing a plane version soon. Fixing translucency rendering for WaveWorks first.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5cee3492](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5cee3492](https://forums.unrealengine.com/u/anonymous_user_5cee3492)\
**Post date:** [October 23, 2015, 9:20am UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/18 "2015-10-23T09:20:55Z")

</div>

Where is the FFT size? Can’t find it.  
://i.imgur/M4aTaR6m.png

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_bcf66e2c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bcf66e2c](https://forums.unrealengine.com/u/anonymous_user_bcf66e2c)\
**Post date:** [October 23, 2015, 10:10am UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/19 "2015-10-23T10:10:23Z")

</div>

> [@](#):
>
> Where is the FFT size? Can’t find it.

I only added it recently. You’ll have to grab the latest code. The WaveWorks asset is now split into Simulation and Parameters. Allows you to set some more parameters. Such as displacement readback, FFT size, Aniso Amount, etc.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5cee3492](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5cee3492](https://forums.unrealengine.com/u/anonymous_user_5cee3492)\
**Post date:** [October 23, 2015, 12:33pm UTC](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226/20 "2015-10-23T12:33:48Z")

</div>

> [@;405642](#):
>
> I only added it recently. You’ll have to grab the latest code. The WaveWorks asset is now split into Simulation and Parameters. Allows you to set some more parameters. Such as displacement readback, FFT size, Aniso Amount, etc.

Thanks dude! Just rebuilt everything! Just why does it needs to recompile every shader every time I’m rebuilding it? I have say like 16,496 shaders unit to compile when loading the editor, and that doesn’t even include 4,512 in the terrain.

[Next page](https://forums.unrealengine.com/t/waveworks-infinite-ocean-planes/45226.md?page=2)
