Skip to main content
gamedev.net
🔒 Locked

Lighting-Problems

Started by Midhas 3 replies 650+ views
Original Post
Midhas
Midhas
Hi, i try to light my QUAD... glNormalf(0.0, 1.0, 0.0); glBegin(GL_QUAD); glVertex3f(-50.0, 0.0, -50.0); glVertex3f(-50.0, 0.0, 50.0); glVertex3f( 50.0, 0.0, 50.0); glVertex3f( 50.0, 0.0, -50.0); glEnd(); ... with a SPOT_LIGHT at Position... x=0.0, y=10.0, z=0.0, ... with SPOT_DIRECTION to ... x=0.0, y=-1.0, z=0.0 ... and a CUT_OFF-Angle of 50.0. The QUAD is only lighted when i increased the CUT_OFF-Value to a higher one, which light-cone of the angle includes at least one Vertex of the QUAD... What did i wrong ? How can i light the QUAD without make sure that one vertex is in the view of the spotlight ? Hope anybody can help me !!! thanks Midhas
Enigma
Enigma
OpenGL''s default lighting is per-vertex. This means that colour is calculated at each vertex of each primitive and interpolated across the primitive. If none of your vertices are lit by the spotlight then your quad will not be lit. You''ll need to either:

a) tesselate your quad
b) use a lightmap
c) use a projective texture
d) use per-pixel lighting using a fragment program

Enigma
Midhas
Midhas
Don''t you have any tutorials or links ? I searched the
full google-world, but i found nothing really helpful stuff.

:-(

thanx, midhas

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.