PDA

View Full Version : True Lighting&Culling



Sam Kovalev
11-08-2004, 12:49 PM
Hi,its me again.
My name is Sam. I need help and a bit of the theory.2 questions:
1.For example, i have a flat object(GL_POLYGON) and a point light. How can i enable changeable lighting on the surface.(Flat Mode? or Divide Object on Small Pieces?)
2.How to cut the back side of object?
I am looking for good advice.
Sincerely Yours, Sam Kovalev.
P.S. Big Thanks to Nico(i've changed to replace) and iznogoud(thaks for theory and stationar light coordinates).

MikeC
11-08-2004, 03:48 PM
Originally posted by Sam Kovalev:

1.For example, i have a flat object(GL_POLYGON) and a point light. How can i enable changeable lighting on the surface.(Flat Mode? or Divide Object on Small Pieces?)
Yes, for the general case you'll need to subdivide your poly into smaller triangles. For some specific cases you might be able to get away with texturing tricks (e.g. lightmapping), and on advanced hardware you could do it all with fragment shaders, but for unextended GL subdivision is the way to go.


Originally posted by Sam Kovalev:

2.How to cut the back side of object?
glCullFace(GL_BACK) ?

I'm not sure what "theory" you're asking for - is there something in particular you're confused about?

cheers
Mike