In my scene I do alpha testing on objects with glAlphaFunc(GL_GREATER, 0). The scene is rendered as I wanted.(a house with see thru windows. Alpha testing is to make the windows see thru). Then I enabled the lighting and ‘*’ , the whole house dissapears!. light setting is as follows
I did the correction for the light setting. But still the house doesn’t get drawn. And I just notice that objects behind the house are visible. they shouldn’t be because I enabled depth testing. That means that color buffer and depth buffer are not updated when the house is drawn with lighting & alpha testing enabled. The house model is store in display list and when I set the house to be drawn the frame rate will drop and that make me believe that the model is actually processed by the display card. I use rgba texture for the house.
I just read the red book and it says that depth buffer isn’t affected if alpha testing failed. that explained why the objects behind the house are visible but the main problem here still unsolved.