Advertisement

GPU ray tracing

Started by December 19, 2022 04:16 PM
33 comments, last by Vilem Otte 1 year, 7 months ago

In Unreal Engine 5 there is a ray tracing option when creating new projects. For fun, I enabled the checkbox, created my project, and then I had to wait for 10 minutes while it compiled 6,500 or so shaders. Unfortunately, there was no visible difference (on my low-end GPU) when I went to run the level.

Can a Niagara fluid simulation cast light and shade on the environment?

Is ray tracing necessary? If so, what hardware supports this ray tracing?

To have the fluid sim hooked up to the global illumination would be a dream, like that scene in the clone war in Star Wars, where there is so much smoke, and the lasers light up that smoke.

I've been informed that I need an nVidia RTX 2000 or better to do ray tracing in the hardware.

Advertisement

taby said:
To have the fluid sim hooked up to the global illumination would be a dream

I would be optimistic this works, even without HW RT.
Their SW RT uses SDF for tracing, and then looks up ‘cards’ on the hit point to get a material. You can see this stuff in some ‘Lumen Preview’.
Idk, how Lumen works in detail, but in general emissive light sources are free with GI solutions.
So it would be easy for them to add fluid as a GI light source for sure, but maybe not yet and they have other priorities.

Lumen does not need HW RT. The software path was developed first.
But it's very expensive non the less, so what low-end GPU do you have?
With my Vega 56 it was low fps, but practical.

I have a GeForce GTX 1650, 4GB of shared RAM.

I know that Lumen is otherwise working…. warp9 and I got glowing red eyes working in Unreal Engine, and it casts light into the scene. So, lights can be any shape. That's pretty cool.

Found this:

https://docs.unrealengine.com/5.0/en-US/how-to-create-particle-effects-that-emit-light-in-niagara-for-unreal-engine/

Looks like it illuminates the ground.

taby said:
If so, what hardware supports this ray tracing?

Any NV RTX GPU, but no GTX.
Any AMD RDNA2 GPU, so the models 6xxx and higher.
Intels ARC GPUs.

But for emissive fluids, HW RT sounds useless, because it primarily works with triangles.
The mesh needs static topology (e.g. a skinned character).
You could use isosurface, but because topology changes every frame, you would need to rebuild the BVH each frame too. So all of that together is expensive, but could work if you don't do much else.

HW RT also supports procedural content. So if the ray hits a box marked to be procedural, you can generate procedural shape and ray intersection with code. (I have forgotten how this shader is called.)
This would be better. You could raymarch the actual Eulerian Grid of smoke simulations. Particles would be difficult, if they lack any volume. Than you would need an acceleration structure for the particles.

SW RT sounds the best option, due to flexibility. HW RT simply is no win here.
SW RT is also faster with Lumen, mostly. At less accuracy, especially with reflections.

So i guess you can use that. Getting some interesting / good looking lighting out of fluidy gas is another problem. I expect some bright blob, but no real structure or shape. Likely it's pretty uniform and lacks direction. Maybe not as cool as expected.
Contrary, if you illuminate the gas with some external light source, the self shadowing and scattering can create interesting and beautiful images. Though, volumetric lighting is limited in realtime. But there sure are some options with UE.

JoeJ said:
Getting some interesting / good looking lighting out of fluidy gas is another problem. I expect some bright blob, but no real structure or shape. Likely it's pretty uniform and lacks direction. Maybe not as cool as expected.

Oh, after watching the VDB video in the blog above… explosions, ofc. :D How could i forget about explosions?
So i guess if you can control emission with some simulation properties, like heat, or pressure… it might look very cool.

Advertisement

I will try those steps, but there is a major difference between using the sprites alone and using them as a fuel source.

I emailed Epic and asked them three questions:

1) Fine control of particle emission in a Niagara System: Is it possible (through Blueprints) to emit a single particle with arbitrary location and velocity somewhere within the simulation grid? This is pretty much the finest level of control that there could be. I don't need to know how to do it, just whether or not it's possible.

2) Texture sampling: Is it possible (through Blueprints) to read back the simulation density and temperature textures from the GPU? For example, I wish to know the temperature at the centre of an actor, to determine if said actor is suffering heat damage. Again, I don't need to know how to do it, just whether or not it's possible.

3) Hardware ray tracing: From what I understand, if I obtain an nVidia RTX 2000 series or better video card, then I will be able to support ray tracing on the hardware. If I enable ray tracing in my project, will the Niagara fluid simulations cast light and project shadow onto the scene? Likewise, will the fluid simulation be lit up from the inside, if a light is placed at the centre of, say, a screen-filling cloud of smoke? I'm totally going to steal all of the effects from Star Wars and Harry Potter, and put them into a spaceship shoot 'em up game. Time is not really of the essence, because I don't care if I'm beaten to the punch, plus my project will be open source, for all to experiment with.

Hopefully the answer to all of these questions is "yes".

Question 3 isn’t a dealbreaker, unlike questions 1 & 2.

See, maybe the isosurface via marching cubes isn’t such a bad idea after all lo

there are dozens of parameters!

Apparently, Lumen takes into account the lighting from a gas emitter, so there are no steps needed to get that working. The only part not working now is the shadows.

This topic is closed to new replies.

Advertisement