PDA

View Full Version : Scissor for both lights AND sectors ?



Undertaker
01-14-2005, 04:07 AM
i saw alot of engines using scissor testing for both lights and sectors (by setting the scissor for portals).

how can i do that with only one scissor possible for pass ?

Gorg
01-14-2005, 07:25 AM
You are trying to make the scissor region as small as possible.
So, clip the light scissor region to the portal scissor region.

Undertaker
01-14-2005, 12:05 PM
ok so that means that the portal scissor is only for clipping the light scissors, i don`t actually enable the portal scissor, only the clipped light scissors are the ones that get enables, did i understand correctly ?

Gorg
01-14-2005, 06:17 PM
Maybe. I am not exactly sure what you mean by not enabling the portal scissor, but I think you get it.

Just in case you don't, I mean precisely this :

Say you have a portal. You calculate the scissor rectangle that you would pass to glScissor if you only worried about portals.

You also have a light that you know is inside the region of the portal. You calculate it's rectangle and you clip it to the portal's rectangle.

That way you get the smallest rectangle you need. You pass this final rectangle to glScissor.