NVIDIA GameWorks Integration

@Maxime.Dupart Thank you for quick job. But In this version of the engine, there is a critical bug on Material. Changing on Material Instances not saving and reset on restart the engine. According to Epic, this will be fixed on 4.19.2 (Unreal Engine Issues and Bug Tracker (UE-57086)) Do you have any plan for 4.19.2?

I just did the 4.19.2 update, thanks for the info

Wow! Super! Thanks a lot.

hey Maxime, any chance you could merge volumetric lights with your branch? awesome work btw :smiley:

Please note that the default tracing settings in VXGI 2.0 result in a larger number of cones being used. So, reduce the Quality to get a similar look to get a more fair comparison.

Also, if you’re only using VXAL, set r.VXGI.AmbientOcclusionMode=1 for extra performance with no difference in the results.

@Maxime.Dupart As I saw you have tested both versions but youtube didn’t let you share the performance results :D. Is there a big performance difference between VXGI 1 and 2?

@Maxime.Dupart Hi again, I have a really interesting situation with VXGI 2 (on your branch). While I have 80 fps in my outdoor scene. If I enable VXGI Indirect Lighting on Directional Light my fps drops to 50 but there is no any visual change because I have not enabled VXGI Diffuse tracing in post process volume yet. After this, if I enable VXGI Diffuse Trace in post progress volume VXGI is appearing and my fps drops to 30. I uploaded viewport values and GPU profiler values. The left one is the default. Middle: Only enabled VXGI Indirect Lighting on Directional Light and Right: enabled VXGI Indirect Lighting on Directional Light + enabled VXGI Diffuse Tracing in Post Process Volume. Also, there is something that GPU profiler couldn’t capture. All GPU Profiler Frame Times lower than actual viewport frame times. What do you think about this situation?

VXGI 2.0 performance if you’re using only VXGI Diffuse with settings for the maximum performance, is really close to the performance you would get with an optimized VXGI 1.0.

Still it would need proper testing, but from my personal test you’re really around the same.

Now, if you’re using VXGI Diffuse and Specular together, performance are drastically better with VXGI 2.0.

Aside from Area light of course, a really nice addition is the ability to combine Diffuse and Ambient Occlusion, previously you either were using VXGI for it’s voxel-based ambient occlusion, or for its global illumination abilities, from now on you can combine both at barely any noticeable extra cost.

After several test run i still can’t decide if whether Diffuse+Ambient Occlusion is costing more than Diffuse alone or not, while the visual impact of extra AO is really noticeable and appreciated.

I don’t have hard numbers, but I can say that from my tests (I’m actually compiling your fork right now) with diffuse tracing and ambient occlusion, the new AO doesn’t appear to be incurring any hits to performance. The visual addition is well worth the sub-millisecond hit, if any, in my opinion. Area lights definitely hit my sad rig hard (rocking a GeForce 750ti), I usually lose ~10-20 FPS.

I’m starting to zero in on magic numbers to get good performance and quality balances, with a main directional light, sky light, and several area lights in a test scene. Fullscreen at 1920x1080, I was getting about 20-30 FPS with higher quality settings. I can imagine that newer GPUs would be getting healthy 60 FPS rates. I plan to cook out a test and pass it on to some peeps to verify that for rigs with better specs, ranging from GeForce 960s to 1070s and I think an AMD GPU somewhere in that pool. Here is a shot from that test scene:

Would be awesome, i would gladly give feedback on your test scenes if you’re interested (currently using a GTX 1080 at 4K). Area Light being completely isolated, it does create its own overhead. If i were to consider using Area light + core VXGI, it would mostly be for the voxel-based AO.

Just did the test on my side with outdoor landscape scene and indeed activating VXGI on lights/skylight, even if there’s no PostProcess with VXGI On in the scene, creates a really noticeable overhead.

That makes sense that one can’t use a material, yeah - an animated texture like scene capture 2d or media texture would be amazing tho! Especially media texture!

Would it be helpful if I submit this as an issue for you in GitHub? :slight_smile:

I have no plan to include nor Nvidia Volumetric light nor TXAA for now. I do love Unreal engine volumetric lightning (which wasn’t available back wen Nvidia solution was), and i didn’t feel like TXAA was a massive improvement over Unreal TAA: to be honest i haven’t noticed any difference, maybe i haven’t looked into it hard enough.

After much tinkering, I’m really liking the screen space shadows that area lights produce. I’m having a heck of a time getting them stable though. Another thing I’m doing is a quality-of-life BP based on the area light actor, that has all those settings, but also drives some material parameters and a few other goodies. In doing that, I realized I should make a sort of core controller BP and tie that into a UI with sliders and buttons and checkboxes, for quicker experimentation with all the settings we have available. Once I get that all tied together, I’ll drop the demo scene in this thread for peeps to experiment with. Could be a bit though.

I’m really excited to start seeing some concrete numbers and stats. Lighting has always been a mysterious creature for a lot of people, and being on the cusp of a solid GI solution is awesome. I’ve tried quite a few different solutions, and by far VXGI has been the most approachable and applicable in different lighting scenarios. Save for large outdoor/landscape scenes. Granted, I bet with some tweaking, we can figure that out too.

We’ll be able to figure this out once Unreal starts having good performance for large outdoors without any GI enabled. This is really Unreal’s biggest weakness. In CE/LY you can fill a big map with lush foliage and dynamic GI, it will perform a LOT better than Unreal with smaller scenes. I really hope they will adress this issue soon enough.

I’m consulting on another team’s project, and took on the task of pulling in a LIDAR scan of Crate Lake, Oregon and running that through World Machine, then pulling into Unreal Engine. It’s a 1:1 scale of an 18km^2 area. It has a lot of trees, rocks, and grass/foliage. A *very *complex material (shows up nasty red in the shader complexity view)… I pull a steady 60 FPS on my potato rig. It really comes down to knowing how to work with the tools ya got. CryEngine has always been tailored to large outdoor terrain, since the first Far Cry. So of course it’s going to shine there. CryTek certainly does a good job of coming out with new tech, no doubt about that. Alas, UE is capable of just as fancy large outdoor areas if you know what you’re doing :wink:

LogD3D11RHI: Error: VXGI Error: VXGI requires a GPU that supports FP16 typed UAV loads natively (DX11.3) or through NVAPI (Maxwell+) when ambientOcclusionMode = false (GI_Base.cpp, 366)

@Alexey.Panteleev >> @Maxime.Dupart
What does that mean now? Will it only work in Maxwell+ after that?

It is nice but it should be a continuation.

SHA-1: 375d35e3e1574030cbf99bc6c6c39082c0b027b9

  • Fixed the crash that happened on the creation of shaders when the GPU does not support FastGS.
    If the GPU doesn’t support typed UAV loads on FP16 data, it will still crash unless r.VXGI.AmbientOcclusionMode is set to 1 before enabling VXGI.

I was actually the one that pointed out that issue. The latest version works for me, and I can freely change r.VXGI.AmbientOcclusionMode, now that shaders have compiled and such. My old boat is still rocking a GeForce 750ti.

@Maxime.Dupart my friend just did same test on 4.19.1 Official Nvidia Branch. He says there wasn’t an fps drop until activating VXGI in Post Procces Volume. Are we have this situation because of 4.19.2 or is there a complication with gameworks features or something like that?

Unless I’m missing something with your issue, you can of course expect a performance drop when enabling VXGI. It’s not free, and the more features/combination of features you enable, the bigger the performance costs. I’m guessing I’m missing something specific though, lol

Of course, VXGI is an expensive feature but the problem is not its cost. I have already shared an ss. I will upload it again with some additionals to make it easy to understand. As you can see in the middle (which is vxgi enabled only on directional light but not in post process so there is no any visual change), there is a 30 fps drop but vxgi not enabled yet and there is no any vxgi element on GPU profiler. And according to my friend, this is not happening on 4.19.1 Nvidia branch. Also, another interesting situation is somehow GPU profiler can’t capture or cant see some elements because in all scenarios GPU profiler shows lower frame times than viewport values.