NVIDIA GameWorks Integration

yeah it’s still a plugin, you can recomplie it :slight_smile:

Has anyone integrated NVIDIA Bokeh Depth of Field?

well I hope you can be able to integrate datasmith…i have no idea how to integrate it! :frowning:

now it’s in 4.19 :confused: i don’t keep 4.18 ver to recomplie it :confused: :confused:

My VXGI 4.17.2 build is running terribly, from demos i seen cannot be right. Its running at 5 FPS when i check “Enable Diffuse Tracing”, my scene doesn’t even change.

My pc is low end but i didn’t expect to have kind of performance at all, never get with LPV.

AMD FX 6300
RX 460
8GB

Thanks man, a solve unistalling a program called WARSAW a bank protector or something like that, maybe exist only in Brasil. Now your Branch runs perfectly. Thanks a lot. Cheers!

Thank you for all the help everyone (mostly Windystrife)!

Has anyone gotten the diffuse fluid particles to work? How did you do it?

VXGI is need very powerful PC, you can reduce settings

To improve cone tracing performance, edit the PostProcessVolume settings:
Disable specular tracing
Set “Diffuse Tracing / Number of Cones” to 4
Set “Diffuse Tracing / Tracing Sparsity” to 4 (quarter-resolution tracing)
Enable “Diffuse Tracing / Use Temporal Filtering” (to remove flickering artifacts)

To improve voxelization performance, set these console variables:
Set “r.VXGI.MapSize 64” (to improve both voxelization and tracing performance)
Set “r.VXGI.MultiBounceEnable 0” (to improve voxelization performance)
Set “r.VXGI.HighQualityEmittanceDownsamplingEnable 0” (to improve voxelization performance)


's what I’ve collected so far for performance. It’s not much mind you, but it should be a good starting point, and others can chime in with their own tips or already posted information in that 84 page thread (too time consuming to read it all if you haven’t been following from the start).

As Blakblt mention in post, default settings for VXGI seems to be intended for mimicking the quality of baked lighting. That is good for archviz and smaller more controlled scenes, but can be problematic for others. You need to fiddle with the settings to get the best quality/performance ratio you want. Defaults are in bold.

Console commands:
r.VXGI.MapSize 32/64/128/256
Changes the size of the voxels. Lower (meaning bigger voxels) is better, but increases leaking and inaccuracies. 256 is unusable in most GPUs today. Although Nvidia recommends 64 for better performance, you’re likely better of setting to 32.

r.VXGI.Range 400
As it says, changes the range. has a side effect however. If you increase range, it also scales the voxel size, it tries to keep voxel count constant so that you don’t get bogged down by too many voxels.

r.VXGI.StackLevels 1/2/3/4/5
As mentioned by Blakbit in post, setting has large impact on performance. VXGI reduces voxel resolution for geometry farther than VXGI Anchor (by default attached to camera). Default setting has 5 levels of different voxel sizes. By reducing stacklevel count, you can increase (or decrease) performance. I recommend reading the linked post for more detailed info. Gist of it is you need to use setting in-conjunction with mapsize and range settings to find a sweetspot that works for your scene.

r.VXGI.MultiBounceEnable 0/1
Enables multibouncing as the name suggests. According to Nvidia overview, it works by using previous frame’s irradiance map in the current frame. Nvidia overview (requires github access) says disabling it increases voxelization performance.

r.VXGI.HighQualityEmittanceDownsamplingEnable 0/1
Mentioned in .'s post and the overview above.

r.VXGI.StoreEmittanceInHdrFormat 0/1
Mentioned in .'s post . affects the multibounce. As he states few posts below, is related to VRAM usage, more info .

Post-Process Volume Settings:
Number of Cones 8
Self explanatory, reducing increases performance. Nvidia recommends 4. Going lower than that produces too many artifacts in my opinion.

Tracing Sparsity 1/2/3/4
Increasing reduces the tracing resolution. Nvidia recommends 4.

Tracing Step 0.01/…/0.5/…/2
Increasing increases performance, but lighting becomes less stable. At level of 2 you can see quite clearly see the colors change as you move through the world. is a case by case setting in my opinion. Some scenes might be more tolerant to than others.

Use Temporal Filtering On/Off
Nvidia’s overview recommends to turn on to hide flickering artifacts when using performance settings.

Enable Specular Tracing On/Off
While turning on does increase visual quality (sometimes considerably), you might want to turn it off if you are having performance problems and still rely on UE4’s SSR for specular highlights. VXGI is also not that good at doing really reflective surfaces, Nvidia overview mentions you can use “r.VXGI.CombineSpecularWithSSR 1” console command to combine VXGI Specular with SSR. Without command SSR gets disabled when VXGI Specular is on.

Unclear performance tips:
presentation mentions use of low-detailed meshes for voxelization. I’m not sure if current UE4 implementation supports using LODs for that.

TL;DR Play with stacklevels, mapsize, and range console variables. Lower tracing quality just enough to find a spot with acceptable level of lighting artifacts. Disable specular if performance still unsatisfactory.

Hello. I loved your work and get it working on my pc. But it have a little problem. Hairwork assests is broken and not showing (sample).

I met error and find out solution for it:)
your branch is missing dll files :smiley:
What branch do you use

i fixed it on lastest commit in my branch (add dll file and fix .gitignore](https://github/windystrife/UnrealEngine/blob/4.18-NVIDIA.GameWorks/.gitignore) for it)
https://github/windystrife/Unrea…IDIA.GameWorks

Or you can check file in “…\Engine\Binaries\ThirdParty\HairWorks”
it needs 2 dll files in it :smiley:
if u don’t see them :slight_smile:
it’s :
https://drive.google/file/d/1Xlw…ew?usp=sharing

It worked Thank you :slight_smile:

Hello everyone!
I’ve question about Flex fluid. Would really appreciate some help.

Flex works great on large scale fluid simulation, but what if I need to simulate filling of just a cup of beer? Did anyone managed to achieve good results in similar scenes? Preferably without scalling everything up. In my scene Unreal Unit = 1 cm.

Specifically the problem is how particles start to jitter and jump trough meshes when touching collisions if their physical size (in Flex Container) is set to low values like 1 ~ 2. I’ve tried to use custom simple collisions as well as complex ones, but the problem still persists. I’ve also tried to set countless combinations of mass, gravity and whole lot other parameters, but they don’t seem to solve the problem. Only thing that helped to some extend is increasing simulation steps, but after some point it fails to do any difference as well.

That’s needed for video, so performance is not first concern. Any advices?

Any luck figuring out if can be fixed? I was hoping it could be done with material or VXGI settings, but no luck so far…

https://forums.unrealengine/community/general-discussion/24447-nvidia-gameworks-integration?p=1438351#post1438351

@**DsyD: **
i cheked it, man :smiley:
you need disable in Post Process Volume “Enable Specular Tracing”
OR you if you need you VXGI Specular with SSR(screen space reflections), use console command: “r.VXGI.CombineSpecularWithSSR 1”

I think the problem isn’t that specular tracing is on, it’s that the entire mesh is ignored when only one material slot is translucent.

In the third picture : https://forums.unrealengine/community/general-discussion/24447-nvidia-gameworks-integration/page287 the Opaque material slots are recognized by VXGI, but one material slot (the top of the table) is ignored. That’s the “correct” behavior I would expect.

In the second picture, the WHOLE mesh is ignored, even though only one material slot should be ignored. Both pictures have specular tracing enabled. And the Opaque materials are identical in both pictures.

The reflection in the second picture should look like the reflection in the third picture, but it’s not. seems like a bug or at least unexpected behavior. I was wondering if it’s user error, like maybe there are some material settings or VXGI settings that would make it behave “correctly”?

@WindyStrife loving your 18.3 build. telling all my friends about it lol
do you have plans to upgrade it to 4.19?

Hi! guys.

I tested ue4 project made by VXGI-4.18 branch version in .

I met error! I don’t know why occured error. help me please.

It’s executed by ue4 4.18.3 original version.

os : windows 10
visual studio 2015


Source file name : D3D11Commands.cpp
error position :

//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void FD3D11DynamicRHI::RHIDrawIndexedPrimitive(FIndexBufferRHIParamRef IndexBufferRHI,uint32 PrimitiveType,int32 BaseVertexIndex,uint32 FirstInstance,uint32 NumVertices,uint32 StartIndex,uint32 NumPrimitives,uint32 NumInstances)
{
FD3D11IndexBuffer* IndexBuffer = ResourceCast(IndexBufferRHI);

// called should make sure the input is valid, avoid hidden bugs
ensure(NumPrimitives > 0);

RHI_DRAW_CALL_STATS(PrimitiveType,NumInstances*NumPrimitives);

GPUProfilingData.RegisterGPUWork(NumPrimitives * NumInstances, NumVertices * NumInstances);

CommitGraphicsResourceTables();
CommitNonComputeShaderConstants();

// determine 16bit vs 32bit indices
uint32 SizeFormat = sizeof(DXGI_FORMAT);
const DXGI_FORMAT Format = (IndexBuffer->GetStride() == sizeof(uint16) ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT);

uint32 IndexCount = GetVertexCountForPrimitiveCount(NumPrimitives,PrimitiveType);

// Verify that we are not trying to read outside the index buffer range
// test is an optimized version of: StartIndex + IndexCount <= IndexBuffer->GetSize() / IndexBuffer->GetStride()
checkf((StartIndex + IndexCount) * IndexBuffer->GetStride() <= IndexBuffer->GetSize(),
TEXT(“Start %u, Count %u, Type %u, Buffer Size %u, Buffer stride %u”), StartIndex, IndexCount, PrimitiveType, IndexBuffer->GetSize(), IndexBuffer->GetStride());

StateCache.SetIndexBuffer(IndexBuffer->Resource, Format, 0);
VerifyPrimitiveType(PSOPrimitiveType, PrimitiveType); <------------------ error line
StateCache.SetPrimitiveTopology(GetD3D11PrimitiveType(PrimitiveType,bUsingTessellation));

if (NumInstances > 1 || FirstInstance != 0)
{
Direct3DDeviceIMContext->DrawIndexedInstanced(IndexCount, NumInstances, StartIndex, BaseVertexIndex, FirstInstance);
}
else
{
Direct3DDeviceIMContext->DrawIndexed(IndexCount,StartIndex,BaseVertexIndex);
}
}
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[Call Stack]

> UE4Editor-D3D11RHI.dll!FD3D11DynamicRHI::RHIDrawIndexedPrimitive(FRHIIndexBuffer * IndexBufferRHI, unsigned int PrimitiveType, int BaseVertexIndex, unsigned int FirstInstance, unsigned int NumVertices, unsigned int StartIndex, unsigned int NumPrimitives, unsigned int NumInstances) Line 1662 C++
UE4Editor-Renderer.dll!FMeshDrawingPolicy::DrawMesh(FRHICommandList & RHICmdList, const FMeshBatch & Mesh, int BatchElementIndex, const bool bIsInstancedStereo) Line 170 C++
UE4Editor-Renderer.dll!FShadowDepthDrawingPolicy<0>::DrawMesh(FRHICommandList & RHICmdList, const FMeshBatch & Mesh, int BatchElementIndex, const bool bIsInstancedStereo) Line 1280 C++
UE4Editor-Renderer.dll!DrawMeshElements<0>(FRHICommandList & RHICmdList, FShadowDepthDrawingPolicy<0> & SharedDrawingPolicy, const FShadowStaticMeshElement & State, const FViewInfo & View, FShadowDepthDrawingPolicyContext PolicyContext, const FDrawingPolicyRenderState & DrawRenderState, const FStaticMesh * Mesh) Line 1391 C++
UE4Editor-Renderer.dll!DrawShadowMeshElements<0>(FRHICommandList & RHICmdList, const FViewInfo & View, const FDrawingPolicyRenderState & DrawRenderState, const FProjectedShadowInfo & ShadowInfo) Line 1420 C++
UE4Editor-Renderer.dll!FProjectedShadowInfo::RenderDepthInner(FRHICommandList & RHICmdList, FSceneRenderer * SceneRenderer, const FViewInfo * FoundView, TFunctionRef<void __cdecl(FRHICommandList &,bool)> SetShadowRenderTargets, EShadowDepthRenderMode RenderMode) Line 1982 C++
UE4Editor-Renderer.dll!FProjectedShadowInfo::RenderDepth(FRHICommandList & RHICmdList, FSceneRenderer * SceneRenderer, TFunctionRef<void __cdecl(FRHICommandList &,bool)> SetShadowRenderTargets, EShadowDepthRenderMode RenderMode) Line 2090 C++
UE4Editor-Renderer.dll!FSceneRenderer::RenderShadowDepthMaps(FRHICommandListImmediate & RHICmdList) Line 2338 C++
UE4Editor-Renderer.dll!FDeferredShadingSceneRenderer::Render(FRHICommandListImmediate & RHICmdList) Line 883 C++
UE4Editor-Renderer.dll!RenderViewFamily_RenderThread(FRHICommandListImmediate & RHICmdList, FSceneRenderer * SceneRenderer) Line 2110 C++
UE4Editor-Renderer.dll!TGraphTask<FRendererModule::BeginRenderingViewFamily'::26’::EURCMacro_FDrawSceneCommand>::ExecuteTask(TArray<FBaseGraphTask *,FDefaultAllocator> & NewTasks, ENamedThreads::Type CurrentThread) Line 784 C++
UE4Editor-Core.dll!FNamedTaskThread::ProcessTasksNamedThread(int QueueIndex, bool bAllowStall) Line 651 C++
UE4Editor-Core.dll!FNamedTaskThread::ProcessTasksUntilQuit(int QueueIndex) Line 560 C++
UE4Editor-RenderCore.dll!RenderingThreadMain(FEvent * TaskGraphBoundSyncEvent) Line 327 C++
UE4Editor-RenderCore.dll!FRenderingThread::Run() Line 478 C++
UE4Editor-Core.dll!FRunnableThreadWin::Run() Line 76 C++
UE4Editor-Core.dll!FRunnableThreadWin::GuardedRun() Line 25 C++

Finally i built UE4 after compiling it on Visual Studio 2015 community. But couple of things i am confused! Can someone help me on . after compilation the UE4 editor automatically opens when i do debugging. well but my problem is that how should i run that same project next time without running Visual Studio.

2nd problem where can i get asset for fluid. to create water.

I will try as soon as posible, now i am too busy :smiley:

will be interesting! Let’s hope that with the recent focus on optimization, VXGI is finally a practical solution.
://schedule.gdconf/session/advances-in-real-time-voxel-based-gi-temporal-super-resolution-presented-by-nvidia/856294