4 ms·
How much slower is Ray tracing for equivalent quality? (Obviously it will vary, but I'd be interested in even a very handwavy estimate)
by AndrewDucker 6y ago
How much slower is Ray tracing for equivalent quality? (Obviously it will vary, but I'd be interested in even a very handwavy estimate)
- dahart 6y agoIt depends entirely on what you do. Ray tracing can be much slower, or same time, or much faster for equivalent quality, depending on what you're rendering. An example of where ray tracing is much faster than rasterizing is when you have extreme amounts of geometry via instancing. With ray tracing, you can render a quadrillion virtual triangles at interactive / real-time rates, where rasterizing can't do that. This is because ray tracing renders a pixel at a time, where rasterizing renders a triangle at a time. Here's an example: https://www.youtube.com/watch?v=2blG7YXq_O8&feature=youtu.be https://www.youtube.com/watch?v=2blG7YXq_O8&feature=youtu.be
- kaba0 6y agoCorrect me if I’m wrong but ray tracing should iterate over every object in the general direction of that ray - and that can be less with things like AABBs and the like, while rasterization can throw away triangles with Z-masking. Is the former all that more efficient?
- dahart 6y agoYou’re right, z-masking and frustum culling can make rasterization much more efficient than having to iterate over all triangles in the scene, and those techniques are used commonly and very effectively in games. The example in that video above has everything in view though, z-masking won’t fix it or get it anywhere close to as fast as ray tracing in this specific case. The main point is that basic ray tracing has an algorithmic complexity that is logarithmic or cube root of the number of primitives (depending on your BVH), while basic rasterization has linear complexity, and that generally remains true even with many effective culling techniques. There are hybrid techniques that try to combine the best of both, so nothing here is absolute, but at some point if you develop a competitive log complexity per pixel rasterizer with a BVH, eventually it basically becomes ray tracing, and you might as well go with the method that trivially gives you shadows and reflections and bounce lighting too.
- kaba0 6y agoThank you for the informative answer!