<p>Whether you use Lumen with hardware acceleration or not, Lumen is based on ray tracing. Software mode uses signed distance fields (SDF) to find intersections along a ray and so called cards to store lighting on geometry. Hardware accelerated ray tracing finds intersection using triangle-based geometry, which can be more precise if the original geometry also is made out of triangles.</p>
<p>You might find this interesting: &quot;https://knarkowicz.wordpress.com/2022/08/18/journey-to-lumen/&quot;, the history of Lumen. I would imagine that a lot of optimization was required, they use a LOD system as an example.</p>
<p>I assume that you want to ray trace SDF:s in your program. Since I don't know enough about your project, I will just assume that you have triangle meshes. An approach is to use a SDF volume centered around each mesh object, inject them into a BVH and trace the SDF volumes along the ray (I think this is the unreal approach). Cards are harder to implement, maybe a volumetric approach is easier in your case?</p>

CC BY-SA 4.0
2023-03-14T00:08:42.760Z
Thanks for the answer and for the link! I understand that Lumen has a software rendering mode, but why would anyone choose not to use hardware acceleration since pretty much every computer today has a GPU?
HelloGoodbye
CC BY-SA 4.0
2023-03-14T00:18:37.233Z
Why do you assume that I'm going to use signed distance fields? Yes, I have triangle meshes—doesn't that mean that I naturally want to use more or less standard computer graphics techniques as much as possible, which are not SDF-based? They seem superior compared with SDFs to me (I imagine they are both quicker and more exact) if you can use them without losing quality. Or isn't that possible for some reason when doing ray tracing?
HelloGoodbye
CC BY-SA 4.0
2023-03-14T07:13:23.573Z
By hardware acceleration I mean specific hardware that computes the triangle or BVH intersections tests, like the RT cores in the RTX gpus. Software ray tracing does not need that specific hardware to work. I assumed you wanted to use SDF:s as that is what Lumen in known for (in a way) unless you specifically target GPU:s that can accelerate the triangle intersection stage. With that said, triangle intersections are possible without them but there might be more work maintaining acceleration structures.
Mathis
CC BY-SA 4.0
2023-03-15T13:51:35.210Z
Yes, I specifically target GPUs. Does that mean I can re-use OpenGL's (or Vulkan's) triangle-intersection functionality, including the accelerating structures for testing for triangle intersections that it has already created, in the ray tracer? Do you know if there is any documentation or guide that explains how to do that somewhere? It would be great if I didn't have to implement my own triangle intersection test but could re-use as much as possible of OpenGL's (or Vulkan's) already existing functionality to do that (and other things, such as vertex interpolation, if that is possible).
HelloGoodbye
CC BY-SA 4.0
2023-03-13T23:56:57.990Z
2023-03-13T23:56:57.990Z
Mathis
<p>In <a href="https://www.youtube.com/watch?v=Id48CD5sgic&amp;t=4m34s" rel="nofollow noreferrer">this YouTube video</a>, the creator mentions that reflections in Unreal Engine 5's <a href="https://docs.unrealengine.com/5.1/en-US/lumen-global-illumination-and-reflections-in-unreal-engine/" rel="nofollow noreferrer">Lumen</a> &quot;work by tracing the path of light as it bounces off of surfaces in the game world.&quot; Does this mean that Lumen uses raytracing? I thought that this was difficult to do in real time on consumer hardware. But more importantly, how can I implement the same technique? Can I do that with OpenGL or Vulkan? How much of the existing rendering pipeline do I in that case need to re-implement myself, and how much of it can I reuse?</p>
<p><em>Side note:</em> I don't only plan to use it for reflections, but also for transparent objects that <a href="https://computergraphics.stackexchange.com/questions/13338/raytracing-in-opengl-or-vulkan">bend light</a> in various ways (for which rendering to a texture doesn't work because there is not a single point from which to do that rendering), but I—perhaps somewhat naively—assume that reflections and refractions can both be implemented using the same or very similar techniques.</p>

<opengl><raytracing><vulkan><reflection><refraction>
How does Unreal Engine 5's Lumen (most likely) implement reflections?
HelloGoodbye
# How does Unreal Engine 5's Lumen (most likely) implement reflections?

(Asked by: username_0 on 2023-03-13)

In [this YouTube video](https://www.youtube.com/watch?v=Id48CD5sgic&t=4m34s), the creator mentions that reflections in Unreal Engine 5's [Lumen](https://docs.unrealengine.com/5.1/en-US/lumen-global-illumination-and-reflections-in-unreal-engine/) "work by tracing the path of light as it bounces off of surfaces in the game world." Does this mean that Lumen uses raytracing? I thought that this was difficult to do in real time on consumer hardware. But more importantly, how can I implement the same technique? Can I do that with OpenGL or Vulkan? How much of the existing rendering pipeline do I in that case need to re-implement myself, and how much of it can I reuse?

*Side note:* I don't only plan to use it for reflections, but also for transparent objects that [bend light](https://computergraphics.stackexchange.com/questions/13338/raytracing-in-opengl-or-vulkan) in various ways (for which rendering to a texture doesn't work because there is not a single point from which to do that rendering), but I—perhaps somewhat naively—assume that reflections and refractions can both be implemented using the same or very similar techniques.

**Tags:** opengl, raytracing, vulkan, reflection, refraction


---

## 1 answers

### Answer by username_1 on 2023-03-13. Score: 3

Whether you use Lumen with hardware acceleration or not, Lumen is based on ray tracing. Software mode uses signed distance fields (SDF) to find intersections along a ray and so called cards to store lighting on geometry. Hardware accelerated ray tracing finds intersection using triangle-based geometry, which can be more precise if the original geometry also is made out of triangles.

You might find this interesting: "https://knarkowicz.wordpress.com/2022/08/18/journey-to-lumen/", the history of Lumen. I would imagine that a lot of optimization was required, they use a LOD system as an example.

I assume that you want to ray trace SDF:s in your program. Since I don't know enough about your project, I will just assume that you have triangle meshes. An approach is to use a SDF volume centered around each mesh object, inject them into a BVH and trace the SDF volumes along the ray (I think this is the unreal approach). Cards are harder to implement, maybe a volumetric approach is easier in your case?

> **Comments:**
> **username_0**: Thanks for the answer and for the link! I understand that Lumen has a software rendering mode, but why would anyone choose not to use hardware acceleration since pretty much every computer today has a GPU?  
> **username_0**: Why do you assume that I'm going to use signed distance fields? Yes, I have triangle meshes—doesn't that mean that I naturally want to use more or less standard computer graphics techniques as much as possible, which are not SDF-based? They seem superior compared with SDFs to me (I imagine they are both quicker and more exact) if you can use them without losing quality. Or isn't that possible for some reason when doing ray tracing?  
> **username_1**: By hardware acceleration I mean specific hardware that computes the triangle or BVH intersections tests, like the RT cores in the RTX gpus. Software ray tracing does not need that specific hardware to work. I assumed you wanted to use SDF:s as that is what Lumen in known for (in a way) unless you specifically target GPU:s that can accelerate the triangle intersection stage. With that said, triangle intersections are possible without them but there might be more work maintaining acceleration structures.  
> **username_0**: Yes, I specifically target GPUs. Does that mean I can re-use OpenGL's (or Vulkan's) triangle-intersection functionality, including the accelerating structures for testing for triangle intersections that it has already created, in the ray tracer? Do you know if there is any documentation or guide that explains how to do that somewhere? It would be great if I didn't have to implement my own triangle intersection test but could re-use as much as possible of OpenGL's (or Vulkan's) already existing functionality to do that (and other things, such as vertex interpolation, if that is possible).  

---

