NVIDIA GameWorks Integration

How to merge all branch NvPhysX (HBAO+, VXGI, Hairwork, Flex,…) up to date with 4.8 release

Im working on it, will probably be available after the weekend. Its not really an easy to explain task, as you may need to make certain changes or judgement calls based on differences from previous engine versions.

Nice, I am looking forward to it. Also can you please do a short intro tutorial on how to use the flex physics simulation with UE4 in particular ?

Open up Doco\FleX in the merged branch and there’s documentation already in there by Nvidia on how to use FleX.

On an unrelated note, bit of a shame that the POM material being worked on over at https://forums.unrealengine/showthread.php?49169-POM-material/page5 won’t be in the engine until 4.9 (already in the branch). Might be a while til 4.9 happens, and it’s a pretty material function. Gotta love the endless waiting game.

Edit: I have no idea how to work it properly yet, but if you grab the branch and download the files, the material function -does- download in “Engine\Content\Functions\Engine_MaterialFunctions01\Texturing”. Putting it in another build of the engine seems to work, even if I haven’t gotten it to display properly in my brief 5 minute tests.

said that it works for 4.8 already, since it was saved with an older build. You can see his response in the POM thread: https://forums.unrealengine/showthread.php?49169-POM-material&p=308052&viewfull=1#post308052
Also, thanks for mentioning where the function is saved, saves a bit of time ^^

When I do the Merged branch port to 4.8 it will also include the POM functions, just because I am using them

…can I hug you?
In all seriousness, is a great thing to hear, since I was planning to use POM in quite a decent amount of cases. BumpOffset is not good enough and tessellation is too expensive.

Well that wasn’t too hard to get working: https://dl.dropboxusercontent/u/7662877/POM.png

Works pretty well, but I noticed that a high amount of depth seems to put the material in shadow for some reason, whether that be the height ratio or simply the result of a large object it’s applied to. Not using the pixel depth offset seems to resolve problem.

I haven’t quite been able to figure out how to get the self shadowing to work, assuming it even can work on a normal mesh instead of just a decal.

The shadow appearing after certain depths is because, when using pixel depth, it still uses the original object during the shadow pass (No parallax), so the object is actually receiving shadows from itself. With the self shadowing, you need to feed it a light vector from blueprints, then I just multiplied the shadow output with the basecolor to get shadows to appear, may not be correct and I did notice some distortion.

Ah, I was wondering how to get the light vector correctly. I was just typing it in manually into the material, which -does- work, it’s just obviously not the ideal solution. Didn’t consider that I would need to use Blueprints for it.

Shadow casting does make it a lot more expensive, thankfully for the most part a normal map handles it pretty well.

Thanks for looking into , it is essential for me to be able to add a flex particle emitter with surface to a blueprint. I have made a video of the second so you can see what I
[/QUOTE]

Indeed looks like a bounds. The FlexFluidSurface component gets the bounds from the connected emitter instances. I haven’t been able to reproduce the. If you haven’t already, could you try to turn off the surface rendering, and re-enable the particle rendering to see whether it happens in the exact same setup otherwise?

I can’t reproduce behavior unfortunately. The performance seems to recover fine for me, when reducing the particle count in the container again. I just have to re-start playing the same map, no need to restart the editor.

Hi

What line did you fix in the engine to get working?

https://github//UnrealEngine/commit/793139177fde57cd9e5a51689c4682d369f223ee

I believe that the problem lies with the flex fluid surface since rendering flex particles (balls) works fine. I have noticed that when I was testing the fluid surface I was at +35286 on Z-axis in my level, and when I moved the flex fluid surface emitter to 0 on Z-axis there where no stuttering at all.

That actually is a possibility, I have noticed that when i turn off gravity and let the fluid rise up for a while, it will turn completely black (The whole surface) based on the height of the highest piece, so maybe ur seeing something similar, but its causing it to vanish rather than just turning black. If so, then yeah not sure on the resolution.

Thanks! I can repro the stuttering now and will look into it.

I’ve been experimenting with VXGI in BrickGame, and it’s ! I have a few questions/issues though:

I have a yellowish light brick that’s emissive. If I set the material to have omni directional emissive, it gets a bit brighter (not surprising), but also more saturated. Looking at the voxel emissive values in r.VXGI.DebugMode=2, the emissive color looks simply white with the omni directional emissive disabled. I can’t see how that flag should affect the color, so I suspect it’s a bug.

I can’t increase the VXGI map size to 256 (as the PDF says I should be able to) without the VXGI library throwing an error about the texture having too many mip levels. Maybe performance wouldn’t even be acceptable with a larger texture, but I’m making a painful sacrifice on nearby voxel resolution to have GI at larger distances, so I’d like to try it at least…

I couldn’t find what license the integration+library is distributed under. I’d love to be able to post a binary build of BrickGame+VXGI, but AFAICT I’d have to get a license from NVIDIA first. Is that correct?

I think the VXGI support for ambient lighting could be much better with some small changes. The VXGI diffuse ambient looks like it only supports 6 directional colors, and the UE4 integration only exposes one color. It also is set up to mimic faked ambient occlusion, where the occlusion of the ambient term decreases with distance. That’s a useful capability, but I’d like the option to just use the final cone occlusion to attenuate the ambient lighting. The VXGI specular ambient can use a cubemap, but it can’t tint it, which I need for time of day transitions in BrickGame. It would be great if you could just give it a single cubemap+tint, and it would use it for both diffuse and specular.

Finally, I have a large radius for my sun’s cascaded shadow map, and it is always rotating. VXGI seems to be using the last cascade to light the voxels, but not blurring it enough to hide the aliasing. Blurring would help, but a better tradeoff might be to get rid of the cascaded shadow map and just use cone tracing for the direct shadowing. There probably isn’t enough resolution for photoreal stuff, but I think it might work well for BrickGame.

And a few screenshots…

Hi ,

I’ll bring your post to the attention of the VXGI team, I don’t have an answer to your question about the map size, or the bug.

Regarding the license, you are covered by the UE4 End User License Agreement. By submitting the code into the UE4 code base on a fork owned by Epic, we are following the terms of the EULA on our side, and you are entitled to use it like any other in UE4. Of course, NV would love to get an advance peek at your game, etc. Feel free to send me a private message if you want to discuss the business side of things in more detail.

Is VXGI emissive material capable of casting shadows? I’m seeing very light coming from my emmisive material. But i dont see the shadows. Is it just me or VXGI does not cast shadows from emissive material?