Jump to content
  • Advertisement
Sign in to follow this  

more light problems

This topic is 3997 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i have a rather large scene, 500x500x500 units that i am trying to light up; im guessing the scene is just too large because i only meakly see ambient lighting. could this be because of the attenuation, and if so how would i go about fixing it? im pretty much following nehe's code and ive tried setting all 3 atten.'s to 0 without any avail.
   glLightfv(GL_LIGHT1, GL_AMBIENT, cenlight.a.m); glLightfv(GL_LIGHT2, GL_AMBIENT, camlight.a.m);
   glLightfv(GL_LIGHT1, GL_DIFFUSE, cenlight.d.m);	glLightfv(GL_LIGHT2, GL_DIFFUSE, camlight.d.m);
   glLightfv(GL_LIGHT1, GL_POSITION,cenlight.p.m); glLightfv(GL_LIGHT2, GL_POSITION,camlight.p.m);
   glEnable(GL_LIGHT1);
   glEnable(GL_LIGHT2);

   glLightf(GL_LIGHT1, GL_CONSTANT_ATTENUATION, 0);
   glLightf(GL_LIGHT1, GL_LINEAR_ATTENUATION, 0);
   glLightf(GL_LIGHT1, GL_QUADRATIC_ATTENUATION, 0);
   glLightf(GL_LIGHT2, GL_CONSTANT_ATTENUATION, 0);
   glLightf(GL_LIGHT2, GL_LINEAR_ATTENUATION, 0);
   glLightf(GL_LIGHT2, GL_QUADRATIC_ATTENUATION, 0);

   glEnable(GL_LIGHTING);

and my scene is just about black.

Share this post


Link to post
Share on other sites
Advertisement
try first with a diretional light eg glLightfv(GL_LIGHT1, GL_POSITION, VEC4(1,1,0,0) );
do u see something?

if so try setting other values than 0 for the attenuation

btw theres also a global ambient function

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!