how can i create global lighting model?

someone told me that in OpenGL only has local
lighting model, is it true?
can i create global lighting model in OpenGL?

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

-SirKnight

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

Global illumination is not exclusive to ray tracing. See particle tracing, radiosity, Doom3, etc.

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.

-SirKnight

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 :stuck_out_tongue:

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

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://24.167.95.242/vault.html 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/&gt;
<http://www.cs.unc.edu/~zhangh/shadow.html&gt;
<http://www-imagis.imag.fr/Membres/George.Drettakis/DM.html&gt;
<http://www.cis.upenn.edu/~diefenba/home.html&gt;
<http://www.cs.cmu.edu/~ph/shadow.html&gt;
<http://www-imagis.imag.fr/Publications/1998/SS98b/MoreInfo.html&gt;
<http://www.stereopsis.com/shadow/index.html&gt;
<http://www.cs.cmu.edu/afs/cs/user/ajw/www/index.html&gt;
<http://www.cs.yorku.ca/~wolfgang/publications.html&gt; http://www.graphics.cornell.edu/~phil/GI/> http://www.helios32.com/resources.htm

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.

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 :stuck_out_tongue:

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.