Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm completely new to this graphics and game development. I have read about Rendering (drawing a 3D graphic on a display 2D) and there are many ways of rendering, Rasterization, Ray tracing, radiosity, ray casting. And my doubt is if OpenGl implements one of these. I mean with OpenGL I can draw lines, circles and so on, so there should be a rendering algorithm on OpenGL, am I right? Which one is it?

What if I want to implement a different rendering algorithm, does this mean I'm no longer using OpenGL?

share|improve this question
Ray casting is a part of raytracing, see . Although often used in raytracing, radiosity is a illumination/lighting model, see . – sarahm Dec 7 '11 at 20:04
Ok got it. But how does OpenGL render lines, circles? What technique does it use? – BRabbit27 Dec 7 '11 at 20:16
up vote 3 down vote accepted

Like Nicol said, virtually every rendering system used in modern 3D games is a rasterizer. Your graphic card is also built with rasterization in mind, so if you implement a raytracer you either have to do it on the CPU or use some more recent "general computation on GPU" technologies such as CUDA because it's not supported directly by your hardware.

With that said, you "can" implement raytracing, rasterization, radiosity, etc., in virtually any rendering system - just don't expect it to run well.

For instance, I've written (for educational purposes) a rasterizer and a raytracer from scratch on Windows Forms and the only thing I needed from the library was GDI and the Bitmap class. Everything else was calculated by the application.

So the answer to the question "Is it possible to implement a ray tracing algorithm while using OpenGL?" would be: sure, but neither the software or the hardware will be helping you, and the result might not fast enough to be used in a game or another realtime application.

What most modern games do (including those built with the enignes you mentioned) is to fake some of the effects of raytracing and radiosity (i.e. global illumination) by using other techniques such as shadow mapping, depth of field and ambient occlusion, which can generate visually similar results with a much smaller computational cost.

share|improve this answer
Yey ! Thanks a lot ! This answer is straight to the point. I get it now ! I understand many things. Indeed I made my Bachelor's thesis on CUDA and then I thought using that technology on graphics and games and that's why I was searching info and there is lot of work about CUDA and rendering. Thanks again! – BRabbit27 Dec 7 '11 at 23:29

In general, you can assume that if a rendering system is not explicitly advertized as a ray tracer, then it's a rasterizer. OpenGL, D3D, REYES (much of it at least), and others are reasterizers.

share|improve this answer
Ok, thanks for clearing that out. Now, is it possible to implement a ray tracing algorithm while using OpenGL? I ask this because of the Unreal Engine and CryEngine, I read they use ray tracing as render algorithm but also they are built over OpenGL (for non-microsoft platforms). – BRabbit27 Dec 7 '11 at 20:36
1 , Point 24.090 - "Can I raytrace with OpenGL?" TL;DR: not directly, but a lot can be faked. – sarahm Dec 7 '11 at 20:55
Unreal and CryTech do not use ray tracing for rendering. – Nicol Bolas Dec 7 '11 at 21:10
In most realtime situations like games, raytracing is not used. There have been some interesting projects using raytracing, but it is still too computationally intensive. However, sometimes raytracing is used in limited amounts, such as line of sight calculations, curved mirrors, ambient occlusion/lightmapping, collision detection and occlusion culling. Also, you can use rasterisation as a first hit calculator. You rasterise position/normal/objectID into buffers (like deferred rendering), and then continue the slower raytracing calculations from there for reflections/refractions. – DaleyPaley Jun 13 '13 at 5:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.