-2

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?

Olivier Moindrot
  • 27,908
  • 11
  • 92
  • 91
Vic
  • 487
  • 8
  • 17
  • 1
    This strikes me as the kind of question that requires a crystal ball to answer. You are either soliciting opinions or asking for a prediction abut the future. Neither are suitable types of questions for StackOveflow. I have voted to close this. – talonmies Jun 06 '12 at 07:59
  • Well, Optix and OpenCL based realtime GPU raytracers with multiple bounces and 1024k resolutions are reality as of 2011, given reasonably complex scenes. Realtime CPU raytracers on simple scenes (albeit with piss poor resolution) were reality in the late 1980s. – Damon Jun 06 '12 at 10:06
  • -1: Welcome to Stack Overflow! Unfortunately, this question is far too opinion-based and "discussiony" for us. We prefer questions that are about specific programming problems, not broad questions about technological comparisons. – Nicol Bolas Jun 06 '12 at 11:07
  • @talonmies I don't see a problem with getting opinions. Even objective questions require opinions. As for predicting the future, some of the answers are giving relevant objective answers. Maybe it is my questioning style you have problem with, where I list what I am essentially interested in even if it is difficult to answer. – Vic Jun 06 '12 at 22:50
  • I have seen purely opinion and technology comparison questions that are well accepted. I guess the difference is that theirs is easy to answer. – Vic Jun 06 '12 at 22:58

2 Answers2

3

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.

datenwolf
  • 159,371
  • 13
  • 185
  • 298
1

For most scenes, raytracing is inherently more work, and therefore slower, than rasterization based methods such as standard OpenGL rendering.

For some applications, it is the other way around. For example, if you have a large number of spheres that you have stored in the right kind of search data structure, it will probably faster to shoot rays through the scene than to draw all the spheres that are in the view frustum on top of each other.

GPUs do support ray-tracing algorithms now, and they have done so for several years. You usually have to implement the algorithms yourself, there is nothing like the pre-packaged algorithms for rasterization that you get with OpenGL. I am sure nVidia has examples in their CUDA SDK. Many high-end effects in real-time 3D graphics trace a few rays even if they are not pure ray-tracing algorithms.

You can write a simple raytracer for a simple scene that runs in real-time on a standard GPU without too much knowledge about how to optimize it.

Google for scientific papers on "real-time raytracing" for the more advanced methods. Have a look at nVidia's CUDA SDK. Maybe AMD has examples as well.

wolfgang
  • 4,883
  • 22
  • 27