View Full Version : how can i create global lighting model?

11-07-2002, 07:59 PM
someone told me that in OpenGL only has local
lighting model, is it true?
can i create global lighting model in OpenGL?

11-08-2002, 04:17 AM
Global Illumination is done with ray tracing, and OpenGL is not a ray tracer, it's a triangle rasterizer. There is a paper about Global Illumination in real-time scenes from SIGGRAPH, you may want to check that out.

Oh and yes OpenGL uses a local illumination model. Maybe you will be interested in this page: http://trident.mcs.kent.edu/~farrell/cg02/lectures/color/illum_local.html


[This message has been edited by SirKnight (edited 11-08-2002).]

11-08-2002, 05:37 AM
Global illumination is not exclusive to ray tracing. See particle tracing, radiosity, Doom3, etc.

11-08-2002, 06:50 AM
True it's not JUST done w/ ray tracing (I meant to add the word etc or something in my first post but I forgot, dang it) but all the techniques for global illumination is way different than how OpenGL does things.

Doom 3 does NOT do global illumination. They use the standard perpixel lights like we see in the demos on ATI's and NVIDIA's demos.


11-08-2002, 07:58 AM
Hrm... you must be using a different definition of global illumination to me, then. Doom3 is pretty much equivalent to Whitted ray tracing after all, minus ideal specular materials.

EDIT: Bleh, can't even spell it properly now :P

[This message has been edited by Maj (edited 11-08-2002).]

11-08-2002, 10:02 AM
im not 100% sure of all these (i really need to tidy up my list of links, ive prolly missed a few)
www.cix.co.uk/~colbeck/glutrad.htm (http://www.cix.co.uk/~colbeck/glutrad.htm) http://freespace.virgin.net/hugo.elias/radiosity/radiosity.htm http://www.uni-kl.de/AG-Heinrich/Alex.html http://www.cs.utah.edu/~schmelze/radiosity/proj/proj.html <http://graphics.lcs.mit.edu/~fredo/>
<http://www.cs.yorku.ca/~wolfgang/publications.html> http://www.graphics.cornell.edu/~phil/GI/> http://www.helios32.com/resources.htm

11-08-2002, 10:55 AM
Doom3 is pretty much equivalent to Whitted ray tracing after all, minus ideal specular materials.

Doom3 applies a successive series of hacks in an attempt to fake the look of global illumination. There is nothing real going on there.

By contrast, Radiosity cannot help but be global diffuse perfect (to the degree that the objects are subdivided). Raytracing can be global specular perfect, if you have enough rays.

With scan conversion, the best you can really do is define a volume to be in shadow of a particular. That is nothing by comparison to either raytracing or radiosity. There's no concept of diffuse or specular interreflection in scan conversion, which is part of global illumination.

Don't let dynamic shadows fool you; it's still just a successive series of hacks.

11-09-2002, 07:32 AM
Well, I consider it global illumination if it takes non-local information into account (occlusion in Doom3's case).

Yes, if you want to define it as anything that takes interreflection into account then Doom3 is definitely not.

Personally, I'd say finite element radiosity and Whitted ray tracing are both hacks too, and that scan conversion has nothing whatsoever to do with lighting, but now I'm just being mean :P

11-09-2002, 12:29 PM
Originally posted by Maj:
Well, I consider it global illumination if it takes non-local information into account (occlusion in Doom3's case).

According to your definition shadow volumes and shadow mapping would be global illumination...

In my opinion the most important part of global illumination is interreflection of the light source. Both raytracing and radiosity solve small parts of it, but it is far from perfect. The nearest approximation to global illumination is the photon casting approach in povray. With a polygon renderer you don't have a chance to get global illumination except you try to fake the effect (which may not be that hard, because we are really bad at recognising correct lighting without having a correct image to compare with).

The various dynamic shadowing technics are only hacks. They don't really calculate anything, they basically just turn on/off lightsources on a per-pixel basis. Shadowing has (nearly) nothing to do with lighting. Shadowing is only the decision IF you calculate lighting on a surface/lightsource pair.