Skip to content

Raytrace time - time for each ray not the same

Question

Why does the raytrace progress dialog show that some rays trace faster than others?

Synopsis

Raytrace time - time for each ray not the same

Solution

The raytrace time for each starting rays is dependent on several factors.

1- The number of ray intersections is one variable. If a ray is emitted from a source and escapes into space, that is 1 ray node. If a ray is emitted down a long fiber and bounces 1000 times before escaping out the end of the fiber, that is 1000 ray nodes. For each ray intersection, TracePro needs to do a calculation to determine the next ray direction, so the number of ray intersections is a big contributor to ray trace time.

2- A second variable is that the calculations required for each ray intersection are not the same. One ray intersecting a surface with Perfect Absorber applied is a quick calculation compared to a ray intersecting a surface with a complex table of values to define the scatter.

3- A third variable to the comparison of the time for each start ray is the number of times the ray is split. If a ray is an incident on a piece of glass or plastic, there is a partial reflection and a partial transmission, so the one original ray is now two rays. The continuation of those two rays is occurring while the Raytrace Progress is still considering them as part of the original starting ray.

For these reasons, there may not be anything wrong with the model or the ray trace, it may simply be that some starting rays take longer than others. However, I can understand that you may want to investigate further. My suggestion to troubleshoot this is to "keep making the model simpler in a way that it still demonstrates the problem". Set aside the concerns of your actual analysis, and do things like reducing the number of rays emitted from the sources, removing objects from the ray trace, removing or replacing properties that are applied to objects and surfaces. The ideal result is that you get the model to trace one ray that is one of the bad/slow rays. Even if you don't achieve the ideal one-ray model, you may get to a point where the explanation for the slow rays becomes apparent.