WaveWorks Infinite Ocean Planes

N8128, Thank you so much for a more thorough explanation on the issue! This will help greatly and hopefully anyone else that comes after us to save them a load of time tracking down this issue. We where suspecting it had something to do with that new ::NeedsLoadForClient() function but where dumb founded as to why it was happening and its nice to get an explanation on why the cooker is stripping out the assets. It all makes more sense now why it had been happening in the 4.12.5 build and not in the 4.9.2 builds.

So I’m starting to assume that the ::NeedsLoadForClient() function can’t be overwritten just for the MaterialExpressionWaveworks.h because all the other expressions run the same check and fail and strip out on cook as well? So now I also see and understand why you are saying we have to change it on a global scale at the root level for UMaterialExpression.



bool UMaterialExpressionWaveWorks::NeedsLoadForClient() const
{
    // We need the asset cooked
    return true;
}

I have fixed the wave works material expression being cooked out by returning true in NeedsLoadForClient(), but the wave works asset still will not show in a cooked build. The cooked build crashes after a “random” amount of time somewhere in either an nvidia dll, or D3D11 itself. This leads me to believe some wave works RHI or other render resource is not being setup correctly during cooked build execution. Any other tips you can provide?

You are correct about doing it only in WaveWorks, it will break other expression because they are not linked to any valid texture reference, so the same check fails as you’ve said. I’ve planned on replying to point out the specifics on doing this, but you figured it out before, so glad it helped!

The crash is caused by parallel renderer, here’s my solution, taken from another email of mine:

"The reason was that in UE 4.12, Epic changed randerer to issue draw calls in parallel by default: “New: Changed PC to default to parallel rendering when not in editor.”. This change is in “WindowsPlatform.h” the “#define PLATFORM_RHITHREAD_DEFAULT_BYPASS 1” changed to “#define PLATFORM_RHITHREAD_DEFAULT_BYPASS WITH_EDITOR” this propages to console variable “CVarRHICmdBypass” in “RHICommandList.cpp” and undirectly enables parallel algorithms. I just use console command “r.RHICmdBypass” and set it to 1 to disable parallel algorithms as was the default until now. I’ve encountered this before and that helped me a lot to figure this one out. "

So to sum it up. Go to “\Engine\Source\Runtime\Core\Public\Windows\WIndowsPlatform.h” and change “#define PLATFORM_RHITHREAD_DEFAULT_BYPASS WITH_EDITOR” to “#define PLATFORM_RHITHREAD_DEFAULT_BYPASS 1” OR probably even better, leave it as it is and change this in the config files or in blueprints with command “r.RHICmdBypass 1”, the important thing is that you turn off the parallel renderer before WaveWorks gets initialized and used. Hope it helps!

Does 4.13_Preview_nvdia_techs contain Waveworks? or 4.12.5_nvdia_techs contain it ?

N8128 As always thank you for the invaluable information!

Tx_Loser - 4.13 does not have any of the waveworks tech in it, at the moment it looks to be only in the 4.12.5 branch. But if you extract out only the waveworks integration you should be able to move it up to the 4.13 branch.

Thanks! But I want to know how use waveworks in the 4.12.5. I did found any project about waveworks,I download waveworks branch and open the project, found the plane and the material is black!

Tx_Loser, I see what your saying now, it took me a sec to understand how to set it all up since there really is no documentation how on to use it or set it up. Also it is very basic and not a fully setup system, all those aspects have to be on you and what you want to do with it. I.E… the material shader is there for the ocean rendering etc… But here is a basic setup on how to work with waveworks.

For the waveworks to work you will need three assets at bare minimum, which includes making the waveworks
asset that houses all the settings for the ocean settings and the waveworks material with a waveworks node
referencing the waveworks asset and also a new blueprint with the waveworks infinite ocean system.
b835902b0d51ab148f40f2669085813bd1ef0db4.jpeg

You need to make a new material for your ocean that will have a waveworks node in it and this node will reference
the waveworks asset and must have a texture coord in the uv’s to work.
cf22159d36abf22f1c0edab79549e41cf34f251e.jpeg

Along with the waveworks node and asset, the shader must have the flat tessellation enabled so the material will
activate the waveworks rendering. If not the material will not work.
fc82ebff0f3910748ac71c08b59f9a46deb27dc3.jpeg

You need to make a new blueprint actor and when you have it created add a new waveworks component. This is
what is the quadtree system for the infinite ocean plane.
b0ff7454639baa06d40b0cc34d7c7d9eb9b29b82.jpeg

Once you have the blueprint with the new waveworks component then you need to assign the waveworks material
to the waveworks component so the infinite ocean plane can render the mesh.
8074305a5fced5746c36a778a0ece1e9c0cf63ca.jpeg

Thanks so much

Thanks so much!

Is this wave geenerator run just by a blueprint ?
i need waves in my game for some of the planets.

If you are using a UE4 Build that has the Nvidia waveworks integrated into it, then yes you setup the wave generator in this fashion by using a blueprint setup.

Could anyone please post minimal working project using WaveWorks.

Are you using the 4.12 waveworks build?

Excuse me, can you tell me how to extract out only the waveworks?

Tx_Loser, This isn’t exactly a very quick and simple thing to do exactly. I had to go back to the engine drop with waveworks,hairworks and the various nvidia tech in it for the 4.12 version and get a blank engine 4.12 and difference the two engines to pull out the difference and then extract out all the waveworks code. Which involved also cleaning out the various other nvidia tech I didn’t need since I was only concerned with waveworks code. Then integrating the isolated waveworks code into our blank work engine 4.12 version for the project we needed to have water in.

Recently one of our lead tech artist took that isolated code and had to integrate it up to 4.14 for us and from talking to him that also had some issue do to with some rendering and file location changes so he had to find those differences and put them in the proper location and adjust for rendering changes. Wasn’t a lot of changes, but enough that it was still more work on top to maintain waveworks.

Thanks a lot !

I have saw an update in waveworks, and I compare waveworks branch with UE4.15 , the github display able to merge . So, does it support ue4.15? If i want merge several nvidia branch, can only click creat pull request?

Update for Unreal 4.15 is pretty sweet… has interaction and wave action with the coast line… This was their update for GDC this year

v=DhrNvZLPBGE

@ I’m trying to use the WaveWorksFloatingComponent for my pawn (boat simulation) however it doesn’t float, it seems to work only for Actors not Pawns, any suggestions?