   messed up scissor
  Hi! I have a strange problem with scissor testing. I am using the scissor to update only the part of the scene affected by a light. I correctly calculate the scissor rectangle but OpenGL always clips the scene incorrectly. Here you can see what I mean:The white rect is the calculated scissor rect. The cube in the middle is messed up. It should be all lit. The GL somehow changes the scissor rect at some point. When I read it back it's ok, but rendering is still messed up. The same effect applies near 2/3 of the screen and only in vertical.Can somebody tell me what is going on?   
  The distance from the top of the image to the edge on the cube between lighting and no lighting seems to be the same as the distance from the bottom of the image to the bottom edge of the white rectangle. This suggest that you use a different coordinate system than OpenGL.Let me guess, you have put the origin in the top left corner, and you use that coordinate system to draw the white rectangle with the same coordinates as you pass to glScissor? OpenGL's coordinate system have the origin in the lower left corner with the positive Y-axis going up, not the upper left corner. This is also different from what the window manager is likely using.Since OpenGL uses the origin in the lower left corner for everything, I suggest you adapt to that and have the origin there yourself. Will save you lots of potential pitfalls and places to convert between the two coordinate systems.   