hevele
hevele

Reputation: 943

Performance of Ray Tracing

I wonder whether we can formulate the performance of ray-tracing. In my primitive ray-tracer, performance depends on this formula mostly: width x height x number of sampler x (number of objects + number of lights)

So for example, in Pixar or any other big companies, do they follow such formula for performance evaluation. Isn't performance depends on triangle count of the objects? For example if I want to calculate roughly the maximum render time of the frame of 1000x1000 with average 500 objects that consists 5.000.000 triangles, would it be possible?

Upvotes: 2

Views: 2819

Answers (2)

Larry Gritz
Larry Gritz

Reputation: 13708

Ray tracers used for serious work use various acceleration methods that make them proportional to log(triangles), not number of triangles. And sometimes sublinear with respect to the number of lights as well (excluding lights that can't affect parts of the scene, collectively sampling all lights at once, that sort of thing).

On the other hand, material changes (even with a fixed resolution and scene geometry) can make a big change as well. For example, making things more or less reflective/refractive can have big changes in the average "ray depth" of the scene.

Generally speaking, for a given set of geometry, lights, and materials, time should be linearly proportional to the total number of rays (i.e. resolution and sampling rate), but that can be thrown off for really big scenes that are partially serialized on reading the scene input (which may be GB and GB of parsing) and reading of texture from disk or network (we routinely have scenes that reference >> 1 TB of texture).

So overall, you would expect time to be somewhat related to:

scene_I/O + xres * yres * samples * (shading_factor + texture_factor + log(triangles)) + texture_I/O

The I/O numbers and arbitrary shading and texture factors that have to do with your materials can make it all hard to predict accurately.

Upvotes: 4

Roee Gavirel
Roee Gavirel

Reputation: 19473

You can only have the upper boundary of the performance.
for example, the calculation would be very fast if all polygons (triangles or others) are not in the view.
But if you wish to calculate the upper boundary you need to define the algorithm specifics: are you using marching-cubes? do you remove back-face polygons, etc...
but for a specific algorithm, the calculation should be pretty straight forward.

p.s. the number of objects is irrelevant only the sum of all their polygons.

Upvotes: 0

Related Questions