User Tag List

Page 1 of 2 12 LastLast
Results 1 to 40 of 58

Thread: WaveWorks Infinite Ocean Planes

  1. #1
    0

    WaveWorks Infinite Ocean Planes

    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.



    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.com/RenderDoc_plugin
    NVIDIA GameWorks merged branch (v4.9.2) (v4.12.5) (v4.13 p2)
    Feel free to Donate if you wish to support me

  2. #2
    0
    Gorgeous! Awesome work GalaxyMan!
    Storyteller - An immersive VR audiobook player

    Dungeon Survival - WIP First person dungeon crawler with a focus on survival and environmental gameplay ala roguelikes

  3. #3
    0
    Samaritan
    Join Date
    Mar 2015
    Posts
    140
    Thanks! How do you create the wavework component? I don't have it in the BP editor.

  4. #4
    0
    Quote Originally Posted by GalaxyMan2015 View Post
    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

  5. #5
    0
    That's awesome!!

    Quote Originally Posted by vinz243 View Post
    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

  6. #6
    0
    Samaritan
    Join Date
    Mar 2015
    Posts
    140
    There's a GameWork plugin now? I used 4.9 engine modified to include nvidia gamework stuff (waveworks+flex+hbao++vxgi)/

  7. #7
    0
    Quote Originally Posted by vinz243 View Post
    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

  8. #8
    0
    Quote Originally Posted by vinz243 View Post
    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
    NVIDIA GameWorks merged branch (v4.9.2) (v4.12.5) (v4.13 p2)
    Feel free to Donate if you wish to support me

  9. #9
    0
    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
    NVIDIA GameWorks merged branch (v4.9.2) (v4.12.5) (v4.13 p2)
    Feel free to Donate if you wish to support me

  10. #10
    0
    Samaritan
    Join Date
    Mar 2015
    Posts
    140
    Quote Originally Posted by GalaxyMan2015 View Post
    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)?

  11. #11
    0
    Quote Originally Posted by vinz243 View Post
    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.
    NVIDIA GameWorks merged branch (v4.9.2) (v4.12.5) (v4.13 p2)
    Feel free to Donate if you wish to support me

  12. #12
    0
    Samaritan
    Join Date
    Mar 2015
    Posts
    140
    A pity. And what about collison with landscape?

  13. #13
    0
    Quote Originally Posted by vinz243 View Post
    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.
    NVIDIA GameWorks merged branch (v4.9.2) (v4.12.5) (v4.13 p2)
    Feel free to Donate if you wish to support me

  14. #14
    0
    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.

    NVIDIA GameWorks merged branch (v4.9.2) (v4.12.5) (v4.13 p2)
    Feel free to Donate if you wish to support me

  15. #15
    0
    Samaritan
    Join Date
    Mar 2015
    Posts
    140
    Awesome work dude!

  16. #16
    0
    Samaritan
    Join Date
    Mar 2015
    Posts
    140
    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

  17. #17
    0
    Quote Originally Posted by vinz243 View Post
    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.
    NVIDIA GameWorks merged branch (v4.9.2) (v4.12.5) (v4.13 p2)
    Feel free to Donate if you wish to support me

  18. #18
    0
    Samaritan
    Join Date
    Mar 2015
    Posts
    140
    Where is the FFT size? Can't find it.


  19. #19
    0
    Quote Originally Posted by vinz243 View Post
    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.
    NVIDIA GameWorks merged branch (v4.9.2) (v4.12.5) (v4.13 p2)
    Feel free to Donate if you wish to support me

  20. #20
    0
    Samaritan
    Join Date
    Mar 2015
    Posts
    140
    Quote Originally Posted by GalaxyMan2015 View Post
    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.

  21. #21
    0
    It only needs to recompile shaders, when I change a vertex factory shader, I could probably be more careful with the ShouldCache function, I plan to do a refactor over the weekend so I will see if I can reduce the number of shaders needing a recompile.
    NVIDIA GameWorks merged branch (v4.9.2) (v4.12.5) (v4.13 p2)
    Feel free to Donate if you wish to support me

  22. #22
    0
    Translucent rendering mostly working now including distortion. Changes will be committed soon.

    This Image Was Automatically Resized by using the Screenshot Tag.  Click to view the full version
    NVIDIA GameWorks merged branch (v4.9.2) (v4.12.5) (v4.13 p2)
    Feel free to Donate if you wish to support me

  23. #23
    0
    Samaritan
    Join Date
    Mar 2015
    Posts
    140
    Awesome! Just a quick question: is it possible to reduce foam amount? Because IRL oceans don't have as much foam:




    I tried disabling beaufort scale but then the ocean disappears.

    Also, is possible to make something like that?



    Or maybe just increase foam amount and decrease tessellation near the landscape. For collision with the landscape you can use the landscape heightmap to represent distance to terrain:




    (from the Kite Demo)

  24. #24
    0
    Yes u can do any of that, it uses just a regular material. Just use the Foam outputs to control how much foam you want visible. Or turn off beaufort scale and set all the settings manually, you have individual control over the foam settings. I am not really trying to create a realistic ocean - Only because I know I can't, I dont really have the material skills to do so, just using the same material to show my progress in other aspects.

    Turning off beaufort scale, you need to set the wind speed up to something other than 0, otherwise all waves will dissapear.

    Changes have been committed
    Last edited by GalaxyMan2015; 10-24-2015 at 04:55 AM.
    NVIDIA GameWorks merged branch (v4.9.2) (v4.12.5) (v4.13 p2)
    Feel free to Donate if you wish to support me

  25. #25
    0
    Samaritan
    Join Date
    Mar 2015
    Posts
    140
    Thanks for the tip! It's weird though that wind speeds affect the ocean scale when Beaufort scale is off.

  26. #26
    0
    Trent Polack
    Founder & CEO of Joy Machine
    Steel Hunters, a third-person mech shooter with randomly-generated items and enormous enemies.
    @mittense | @joymachinegames

  27. #27
    0
    Thanks, I'll give I'll see how it goes, its definitely already better than anything I've made to date in regards to water. In the mean time. Working on my prototype GameWorks game. Have a better buoyancy model going. I dont need anything perfect and mixed in some FLEX elements.

    NVIDIA GameWorks merged branch (v4.9.2) (v4.12.5) (v4.13 p2)
    Feel free to Donate if you wish to support me

  28. #28
    0
    Will we ever get Waterworks in UE4 to look anywhere as good as the NV tech demo? The buoyancy model there and the way the bow of the ship breaks the waves is awe-inspiring.

  29. #29
    0
    Sure you can do that, take a look at the Community Ocean project for an example on implementing a mesh buoyancy model. Then using the returned displacement values, you can spawn a particle system to simulate splashing, and since the WaveWorks mesh just uses a regular material, you can combine it with other displacement methods.

    I won't be implementing any of that into my branch because that is a per game thing, for my game I only require very simple point based displacement. I leave it up to the individual to implement what is required. The only thing I have provided is the ability to read back the displacements at any given point.
    NVIDIA GameWorks merged branch (v4.9.2) (v4.12.5) (v4.13 p2)
    Feel free to Donate if you wish to support me

  30. #30
    0
    Why Me Ocean Quality Is So Bad....? :/
    Name:  Ocean.jpg
Views: 2013
Size:  254.1 KB

  31. #31
    0
    Quote Originally Posted by 01767456513parag View Post
    Why Me Ocean Quality Is So Bad....? :/
    Make sure to set the quality to Extreme in the WaveWorks asset. Then play in editor and set res to something like 1920x1080. At lower resolutions it can look a little blurry and such.
    NVIDIA GameWorks merged branch (v4.9.2) (v4.12.5) (v4.13 p2)
    Feel free to Donate if you wish to support me

  32. #32
    0
    Quote Originally Posted by GalaxyMan2015 View Post
    Make sure to set the quality to Extreme in the WaveWorks asset. Then play in editor and set res to something like 1920x1080. At lower resolutions it can look a little blurry and such.
    Still The Same..

    Name:  T1.jpg
Views: 1925
Size:  236.5 KB

    Name:  T2.jpg
Views: 1931
Size:  183.8 KB

  33. #33
    0
    Quote Originally Posted by 01767456513parag View Post
    Still The Same..
    You will need to experiment, I cannot walk you through setting it up perfectly, I have provided the integration, now its up to you to make it look good. As seen by my screenshots it is possible to have a good look.
    NVIDIA GameWorks merged branch (v4.9.2) (v4.12.5) (v4.13 p2)
    Feel free to Donate if you wish to support me

  34. #34
    0
    I'm having problems setting up the ocean. Can't get it to even show up at all!

    Coming 2016| Interested joining my team, email me: daniiartsstudio@gmail.com
    Official Thread! Unreal Forums Follow us on Facebook Watch development blog on Youtube

  35. #35
    0
    Quote Originally Posted by liondog View Post
    I'm having problems setting up the ocean. Can't get it to even show up at all!
    Nevermind, I figured it out!

    Coming 2016| Interested joining my team, email me: daniiartsstudio@gmail.com
    Official Thread! Unreal Forums Follow us on Facebook Watch development blog on Youtube

  36. #36
    0
    Quote Originally Posted by GalaxyMan2015 View Post
    Thanks, I'll give I'll see how it goes, its definitely already better than anything I've made to date in regards to water. In the mean time. Working on my prototype GameWorks game. Have a better buoyancy model going
    Thanks very much for providing this branch!
    We just started looking into different water techniques and it looks great! We will try to join our physics buoyancy that we use in our game right now with this.

    One question: I built your engine branch and tested the project on my laptop and get like >20ms worth of draw calls. Is this normal? It is just a i5-4200M 2.5GHz though. What do you get on your processor? Is the Waveworks implementation that draw call heavy?

    Did you follow up with your game?


    Name:  WaveworksTest.jpg
Views: 1408
Size:  296.5 KB

  37. #37
    0
    So here at work we've adopted the Nvidia Waveworks solution for a project we are currently working on and thanks to the great work you did GalaxyMan2015 we where able to strip out the wave portions and integrate to our engine build. I was curious to know if anyone that uses it has ever tried to actually cook a build and if so if the waveworks portion work properly in your cook build. Thanks!

  38. #38
    0
    Quote Originally Posted by DigiTecK3D View Post
    So here at work we've adopted the Nvidia Waveworks solution for a project we are currently working on and thanks to the great work you did GalaxyMan2015 we where able to strip out the wave portions and integrate to our engine build. I was curious to know if anyone that uses it has ever tried to actually cook a build and if so if the waveworks portion work properly in your cook build. Thanks!
    I shipped a VR game with WaveWorks and a bunch of other NVIDIA tech (working on AMDs VR integration right now), getting everything to production ready state for all GPUs, HMDs and systems was quite a project.

    The first thing that comes to my mind is that you're assigning your WaveWorks shader from blueprints to your WaveWorks component. So WaveWorks gets initialized before it knows which shader/material to use. This will result in a NULL pointer to your WaveWorks material and nothing will get initialized.
    To get around this, you will have to assign your material the other way around, from the code and than expose your material instance from the code to blueprints - if you need to do something with it on that level. Don't forget, you can debug this, build your game in debug or development configuration and than you will be able to attach the debugger to the game, WaveWorks will get loaded when the first instance is initialized,
    so if you have an ocean, spawn it manually with a keyboard key and make sure to attach your debugger before you spawn it. That way you should be able to debug your WaveWorks initialization code in packaged state. Hope it helps!
    Last edited by N8128; 12-13-2016 at 01:52 PM.

  39. #39
    0
    Hi N8128, Thank you for taking the time to point out this information to me. Our lead programmer has been tracing down the issue and it seems on point with exactly what your saying. And yes at the moment I've been following the pointed out method on how to setup the wavesworks quadtree setup as all others have been doing as in the attached image. I figured that this was the way to do it, now on a weird note if you go back to the UnrealEngine-4.9.2_NVIDIA_Techs build from galaxyman the cook process works perfectly and there are no issues, but in the 4.12.5 build intergration this is where we start to run into the problem. Again thanks for the info, going to see what we can figure out with this. Its a great start and lead to try to figure out this problem.
    Attached Images Attached Images  

  40. #40
    0
    No problem. I know what you're talking about, your WaveWorks expressions get stripped in 4.12.5, I'll just copy/paste my part of the email dialog with NVIDIA in October:

    "First, it took me a while to figure out why WaveWorks is not working in the packaged game, after seeing that there are MaterialExpressions missing in the ocean shader (that's using WaveWorks) when debugging packaged game,
    I searched UE4 release notes and found this: "New: Material expression objects that are not required in cooked build will now be stripped from cooked packages.". Since I clearly needed all stripped expressions in ocean material, there had to be a problem.
    Indeed it was, in the file (UE4 project) "MaterialExpressions.cpp" there are multiple new overriding methods that start with "NeedsLoadFor..." these return true is something (like material expression, material function call etc.) is needed in a certain context (Client, Server) or false if is not.
    My problem was caused by "bool UMaterialExpression::NeedsLoadForClient() const" that stripped my WaveWorks expression because it assumes that "Expressions that reference texture objects need to be cooked" the WaveWorks expression does not DIRECTLY reference texture object and therefore it gets stripped and breaks the material,
    which triggers a series of events that totally disable WaveWorks.

    Quick fix is to just always return true in these functions. I ended up adding "bool NeverStrip;" to UMaterialExpression and then returning true if(expression has texture reference or NeverStrip is true), so that you can check that in the material editor for situations like this."

    Follow the above and it should fix your 4.12.5 problem.
    Attached Images Attached Images  

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •