Advertisement

Does anybody know lighting?

Started by May 03, 2001 11:15 AM
4 comments, last by Chronoslade 23 years, 6 months ago
Is there a limit to how many lighting sources that can be created at one time? "There is humor in everything depending on which prespective you look from." Edited by - chronoslade on May 3, 2001 2:50:47 PM Edited by - chronoslade on May 4, 2001 9:26:42 AM
"There is humor in everything depending on which prespective you look from."
In OpenGL it is 8 (dunno about D3D8) - though some hardware support 64 dynamic light sources. If you use all 64 then watch as your frame rate plummets.

Best off doing your own.


Stay Lucky, Graham "Mournblade" Reeds,
ICQ: 30514803
http://homepage.dtn.ntl.com/grahamr
Stay Lucky, Graham "Mournblade" Reeds,ICQ: 30514803http://homepage.dtn.ntl.com/grahamr/
Advertisement
Now more questions. How can you tell how many can be created?
Can the be created and destroyed on the fly? Can the be assignned to certain objects?



"There is humor in everything depending on which prespective you look from."
"There is humor in everything depending on which prespective you look from."
Any help anyone?


"There is humor in everything depending on which prespective you look from."
"There is humor in everything depending on which prespective you look from."
In D3D8, use the dwMaxActiveLights member of the D3D8CAPS to figure out how many lights you can have enabled at the same time.
Get the value with

int n;
glGetIntegerv (GL_MAX_LIGHTS , &n);

The minimum number should be 8.

But real time lightning is too slow ( exception for some video card$$$ ) and in some application it is unuseful (because it does not compute any shadow ).

However if you want to use OpenGL lightning you have to describe every light (dont use more than 8 lights at once but recreate gl lights from memory).
For every object you can turn on/off a specific light ( glEnable(GL_LIGHTi) i=0,1,2,...7 )

Get some tutorial-code about material and light !!!






Edited by - Andrea on May 5, 2001 10:54:48 AM
IpSeDiXiT

This topic is closed to new replies.

Advertisement