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.
Translucent rendering mostly working now including distortion. Changes will be committed soon.
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)
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
Thanks for the tip! It’s weird though that wind speeds affect the ocean scale when Beaufort scale is off.
You can use my material as a starting point; I’ve added some bells and whistles to it (though it’s by no means perfect):
https://www.dropbox/s/bsl9r68x1m45wrv/m_waveworks.uasset?dl=0
https://www.dropbox/s/vdaiqweqw0i0zld/mi_waveworks.uasset?dl=0
https://www.dropbox/s/zyvt3wnbsqibkdv/waveworks.uasset?dl=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.
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.
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.
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.
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.
I’m having problems setting up the ocean. Can’t get it to even show up at all!
Nevermind, I figured it out!
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?
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 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!
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 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.
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.