PDA

View Full Version : lightning effect



sikander
02-26-2003, 02:52 AM
how to have lightning effect in my application. I am using gl functions and building the application in win 32 environment. Moreover how to create multiple light sources.

please help me asap or give me some links of nice tutorials abt this.

sikander

rIO
02-26-2003, 03:22 AM
Do u mean lighting or lightning ??
Of course OGL doesn't have any lightning functions..
For lighting it depends a lot on what kind of result you want to achieve.
Just set the right light/material parameters and siwthc on light with glEnable(GL_LIGHTING)
Try searching for glLight and glMaterial specs.

Formore advanced results better to use per pixel lighting and vertex/fragment programs, but this is a more "advanced" feature.

sikander
02-26-2003, 04:07 AM
sorry i mean lighting. can give me some example code for lighting effect and how to put multiple light sources.
some links ....

nexusone
02-26-2003, 05:08 AM
This site is a good place to start:

nehe.gamedev.net



Originally posted by sikander:
how to have lightning effect in my application. I am using gl functions and building the application in win 32 environment. Moreover how to create multiple light sources.

please help me asap or give me some links of nice tutorials abt this.

sikander

starman
02-26-2003, 07:31 AM
Try the FAQ (http://www.opengl.org/developers/faqs/technical.html#indx0180) or a basic OpenGL book, like the Programmers Guide (aka Red Book) or SuperBible.