<p>I found a very nice paper regarding <a href="http://www.cemyuksel.com/research/papers/time_interval_ray_tracing_for_motion_blur-high.pdf" rel="nofollow noreferrer">Time Interval Ray Tracing for Motion Blur</a> published in 2017. That was before RTX GPUs were on the market.
I have a few questions about an optimal implementation and its performance.</p>
<p><strong>Short introduction:</strong>
I'm using the Vulkan api to raytrace outer space scenarios, like spacecraft docking scenarios. So the scenario has only one till max 10 spacecrafts, which are close enough to be visible. Each spacecraft is very detailed. It is optimized to only have the outer shell, so they have no geometry inside. The spacecraft geometries has up to 50.000 triangles each. And the scenario should be rendered in real-time (hopefully 60 fps).</p>
<p><strong>Problem</strong>: So when using the Motion Blur algorithm linked above, The number of triangles will increase to factor *3 when only using two keyframes. These new triangles and their position / orientation will change from frame to frame. And each frame I have to store the new triangles to the Bottom-Level-Acceleration-Structure (BLAS). Do you guys see a performance problem here?
So the idea is to use the render pipeline (from vertex- till geometry- shader) to create the 4D (3D + time) geometry on GPU. Rotations are the most problematic transformations. To have a good rotational movement, the number of keyframes need to be increased depending on the rotational speed and the exposure time. I think these keyframes need to be split into several BLAS (one BLAS for each keyframe transformation).</p>
<p>In case to fill the BLAS is no performance problem, I think the next problem could be to fire rays.
When having fast camera movements or fast translating spacecrafts, a ray could hit a lot of primitives (triangles). Is this a performance problem? Usually the scenario is very simple.
We are trying to generate the output image as realistic as possible, so the different blending functions are extremely interesting for us.</p>
<p><strong>Questions:</strong></p>
<ol>
<li>How performant is filling the BLAS? (I thought about refitting acceleration structures, because the number of primitives will not change)</li>
<li>Is it better to use several BLAS for the same objekt in case of faster rotations and therefore several keyframes?</li>
<li>How performant is firing the rays?</li>
<li>Do I have enough performance to fire even more rays? Shadow rays, reflection / refraction rays, Photon mapping rays?</li>
<li>Did someone even tested the algorithm with a newer RTX graphics card? (For this project we will use a NVIDIA RTX3080)</li>
<li>Do you know other techniques which better fit to our scenario for real-time?</li>
</ol>
<p><strong>EDIT:</strong></p>
<p>I added this self made image, just to show how I think this algorithm works...</p>
<p><a href="https://i.sstatic.net/V8HHn.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/V8HHn.png" alt="enter image description here" /></a></p>
<p>When having both intersection points of a triangle, I can calculate the UV-coordinates and do texture lookup do get a very good motion blur effect. With this technology I can implement all kind of shutter for my simulated physical camera.</p>

CC BY-SA 4.0
2021-10-27T22:16:39.937Z
You can use the standard integration of time if you want to avoid constructing additional triangles. It's the "worse" techniques they compare to (also they do not compare to dithered blue noise time sampling, which would severely improve the look of those, and would be fixed with a small blur), those introduce some noise, but do not require you to construct new triangles. If the motion of said spaceships can be represented through a linear transformation, then you don't even need to touch the blas, as you can instead apply the inverse linear transformation to the rays.
lightxbulb
CC BY-SA 4.0
2021-10-28T19:23:31.360Z
Assume that you transform your spaceship using a matrix $M(t)$ where $t \in [0,1]$. Then you can instead use the ray with origin: $(M(t))^{-1}(\vec{o},1)$ and direction $(M(t))^{-1}(d,0)$ to intersect the mesh. By sampling $t$ randomly in $[0,1]$ you get rays at different moments in time, and consequently motion blur. To make it easier to denoise the samples can be offset using the idea from the paper "blue noise dithered sampling".
lightxbulb
CC BY-SA 4.0
2021-10-29T08:33:19.073Z
@lightxbulb 1st: Yes, the transformations are linear, so the geometry will only be translated and/or rotated. I am not sure if I understand your solution correctly... Is it correct, that with your solution I fire a lot of rays per pixel in time (10 for example) each image (each ray) is of cause correct, and later I blend the results to one image (like  moving the object 10 times per image?). And to not have artifacts, I blur the 10 images? Do you have a paper for this technique? How many time steps are possible per frame to still have real time conditions?
Thomas
CC BY-SA 4.0
2021-10-29T09:35:55.483Z
In a standard ray-tracer, you shoot rays from a pixel, and average their contribution. In what I am describing you shoot rays from a pixel and associate each ray with a time,  and average. There are probably many papers on extensions of this, but it's ultimately just numerical integration over time.
lightxbulb
CC BY-SA 4.0
2021-10-29T12:25:30.250Z
@lightxbulb okay, so with your solution, I would run into problems, for example a satellite passes (~8km/s) it is unlikely, that any time-ray will hit this satellite, because of its speed. With the solution (question technique) you will see the satellite when setting the "gain" value of your camera very high. Because the prism (triangle - time geometry) will be in front of your screen, so the final image will render the satellite (blurred but correct). Am I right? Or did I miss understood your algorithm? Thanks a lot for your help! =)
Thomas
CC BY-SA 4.0
2021-10-29T13:11:40.760Z
The faster your satellite, the fewer samples will land on it. If you have an estimate on the time interval when the satellite is in the frustum of the camera you can importance sample this part of the interval to reduce variance. Generally very fast objects would introduce more variance and will require more samples to get a smooth solution. I also suggest the "blue noise dithered sampling" paper's algorithm applied to the the time dimension in order to get something nicer.
lightxbulb
CC BY-SA 4.0
2021-10-29T13:25:25.087Z
@lightxbulb okay i got it. Thank you very much! that really helps a lot!
Thomas
CC BY-SA 4.0
2021-10-29T22:32:36.360Z
"How performant is..." questions can best be answered by trying it on your hardware and scene, and benchmarking it. No one on Stack Overflow is going to be able to tell you those answers since it depends so much on exactly what your setup is.
Nathan Reed
<raytracing><vulkan><real-time>
Time Interval Ray Tracing performance
Thomas
# Time Interval Ray Tracing performance

(Asked by: username_0 on 2021-10-27)

I found a very nice paper regarding [Time Interval Ray Tracing for Motion Blur](http://www.cemyuksel.com/research/papers/time_interval_ray_tracing_for_motion_blur-high.pdf) published in 2017. That was before RTX GPUs were on the market.
I have a few questions about an optimal implementation and its performance.

**Short introduction:**
I'm using the Vulkan api to raytrace outer space scenarios, like spacecraft docking scenarios. So the scenario has only one till max 10 spacecrafts, which are close enough to be visible. Each spacecraft is very detailed. It is optimized to only have the outer shell, so they have no geometry inside. The spacecraft geometries has up to 50.000 triangles each. And the scenario should be rendered in real-time (hopefully 60 fps).

**Problem**: So when using the Motion Blur algorithm linked above, The number of triangles will increase to factor \*3 when only using two keyframes. These new triangles and their position / orientation will change from frame to frame. And each frame I have to store the new triangles to the Bottom-Level-Acceleration-Structure (BLAS). Do you guys see a performance problem here?
So the idea is to use the render pipeline (from vertex- till geometry- shader) to create the 4D (3D + time) geometry on GPU. Rotations are the most problematic transformations. To have a good rotational movement, the number of keyframes need to be increased depending on the rotational speed and the exposure time. I think these keyframes need to be split into several BLAS (one BLAS for each keyframe transformation).

In case to fill the BLAS is no performance problem, I think the next problem could be to fire rays.
When having fast camera movements or fast translating spacecrafts, a ray could hit a lot of primitives (triangles). Is this a performance problem? Usually the scenario is very simple.
We are trying to generate the output image as realistic as possible, so the different blending functions are extremely interesting for us.

**Questions:**

1. How performant is filling the BLAS? (I thought about refitting acceleration structures, because the number of primitives will not change)
2. Is it better to use several BLAS for the same objekt in case of faster rotations and therefore several keyframes?
3. How performant is firing the rays?
4. Do I have enough performance to fire even more rays? Shadow rays, reflection / refraction rays, Photon mapping rays?
5. Did someone even tested the algorithm with a newer RTX graphics card? (For this project we will use a NVIDIA RTX3080)
6. Do you know other techniques which better fit to our scenario for real-time?

**EDIT:**

I added this self made image, just to show how I think this algorithm works...

[![enter image description here](https://i.sstatic.net/V8HHn.png)](https://i.sstatic.net/V8HHn.png)

When having both intersection points of a triangle, I can calculate the UV-coordinates and do texture lookup do get a very good motion blur effect. With this technology I can implement all kind of shutter for my simulated physical camera.

**Tags:** raytracing, vulkan, real-time

> **Comments:**
> **username_1**: You can use the standard integration of time if you want to avoid constructing additional triangles. It's the "worse" techniques they compare to (also they do not compare to dithered blue noise time sampling, which would severely improve the look of those, and would be fixed with a small blur), those introduce some noise, but do not require you to construct new triangles. If the motion of said spaceships can be represented through a linear transformation, then you don't even need to touch the blas, as you can instead apply the inverse linear transformation to the rays.  
> **username_1**: Assume that you transform your spaceship using a matrix $M(t)$ where $t \in [0,1]$. Then you can instead use the ray with origin: $(M(t))^{-1}(\vec{o},1)$ and direction $(M(t))^{-1}(d,0)$ to intersect the mesh. By sampling $t$ randomly in $[0,1]$ you get rays at different moments in time, and consequently motion blur. To make it easier to denoise the samples can be offset using the idea from the paper "blue noise dithered sampling".  
> **username_0**: @username_1 1st: Yes, the transformations are linear, so the geometry will only be translated and/or rotated. I am not sure if I understand your solution correctly... Is it correct, that with your solution I fire a lot of rays per pixel in time (10 for example) each image (each ray) is of cause correct, and later I blend the results to one image (like  moving the object 10 times per image?). And to not have artifacts, I blur the 10 images? Do you have a paper for this technique? How many time steps are possible per frame to still have real time conditions?  
> **username_1**: In a standard ray-tracer, you shoot rays from a pixel, and average their contribution. In what I am describing you shoot rays from a pixel and associate each ray with a time,  and average. There are probably many papers on extensions of this, but it's ultimately just numerical integration over time.  
> **username_0**: @username_1 okay, so with your solution, I would run into problems, for example a satellite passes (~8km/s) it is unlikely, that any time-ray will hit this satellite, because of its speed. With the solution (question technique) you will see the satellite when setting the "gain" value of your camera very high. Because the prism (triangle - time geometry) will be in front of your screen, so the final image will render the satellite (blurred but correct). Am I right? Or did I miss understood your algorithm? Thanks a lot for your help! =)  
> **username_1**: The faster your satellite, the fewer samples will land on it. If you have an estimate on the time interval when the satellite is in the frustum of the camera you can importance sample this part of the interval to reduce variance. Generally very fast objects would introduce more variance and will require more samples to get a smooth solution. I also suggest the "blue noise dithered sampling" paper's algorithm applied to the the time dimension in order to get something nicer.  
> **username_0**: @username_1 okay i got it. Thank you very much! that really helps a lot!  
> **username_2**: "How performant is..." questions can best be answered by trying it on your hardware and scene, and benchmarking it. No one on Stack Overflow is going to be able to tell you those answers since it depends so much on exactly what your setup is.  

---

## 0 answers

