This is a simple cube with 6 faces ( 6 quads ). and yes I use the gl lights stack.
Dividing the faces should yield better results in the way the spot light’s cutOff shows on the face. It’s shouldn’t flickers.
Try the cortona VRML viewer on such a file.
( I can send you one )
ok, i’m sure in a few hours the rest of the board will wake up and probably solve your problem in one quick sentance, but something’s still bugging me…
each face of the cube is one quad, and you’re using hw lights. If I’m not mistaken, the light’s colour contribution is computed per-vertex. So you shine a spotlight on the face and you only have five possilbe results:
no vertices are within the light’s effect resulting in no light.
one vertex is under the light
all vertices are under the influence of the light.
as you rotate the cube, the number of affected vertices will change, and since there are only 5 different states possible, I don’t see how flickering can be avoided.
If this isn’t the problem, then I apologize for wasting your time, but when I was first playing around with lights, this issue creeped up on me more times than I’d like to remember.
in my rather shaky opinion, I don’t think 12 is going to give you the expected results. I’ve bumped the poly resolution to 100 per face and still seen some fragmentation. I guess this is just one of the limitations of gouraurd shading, and you can see evidence of this in some of the newer games, especially MechWarrior4 ( not OGL, but the theory is still the same ).
I’d recommend coding up various levels of subdivision and choose the one that works best for your requirements. I use the same video board as you here at work, and it’s limited set of extensions have caused me a few headaches as well.
You could try to fake lighting by using a texture instead, if you want to light a low-poly model. Using the normals as texture coordinates… I used this heavily to fake phong shading during my demo coding days, it’s basically environment mapping with a special ‘light’ texture that is bright in the middle and black at the edges.
There is no way to get good lighting on a cube with such low polys. Gouraud simply does not work that way. Using a GF3 and pixel shaders will do the trick, but the standard OpenGL lighting model simply does not work that way.
I am afraid there isnt much you can do other than add per-pixel lighting(PPL) support (which is a bit more difficult, and not universally support by graphics cards). Sure, make your engine support any size mesh, but unless you do PPL, your graphics artists are just going to have to understand that if they use very low resolution meshes they are going to see bad lighting. And even if you do support PPL, on cards that dont support it you are going to have to drop back to using regular lighting, and the error will show up again.
Of course, there is also the chance that we are not understanding your problem correctly (althouh I doubt it…sounds pretty clear cut). Could you post some screenshot on a web page somewhere?