Search code examples
openglgraphicsgpuraytracing

Speed of ray tracing compared to e.g. OpenGL (or other graphics implementation)


If OpenGL can achieve fast (relative) frame rates because part of the pipeline is processed by the GPU, how would it perform without a GPU, i.e. done purely in software? Would it be the same order speed as ray tracing? Slower?

Could GPUs ever support some part of ray tracing algorithms? Could ray tracing become fast enough to be used in interactive scenes or games in the future?


Solution

  • You really can't compare OpenGL and raytracing in that way. OpenGL is a rasterizer drawing API, i.e. it just puts single points, lines and triangles to the screen. There's no such thing like a scene or coherent geometric objects.

    Even if implemented in software, a rasterizer like OpenGL can be blazingly fast, quite easily. The rendering complexity with rasterizers mostly depends on the amount of input geometry. Since everything happens locally (= one triangle at a time) it's also quite cache friendly.

    Raytracing is a global rendering model. Hence you need to keep the whole scene in memory and for every ray cast into the scene it can theoretically interact with every part of the scene. Usually a cutoff on interactions is preset, which then means, that the total complexity of rendering a frame solely depends on the number of samples taken, i.e. pixel rendered.