Set render limit region with setScissorRectangle

Started by
1 comment, last by Volgogradetzzz 11 years, 6 months ago
Hi. I'm a flash programmer and in our API we have setScissorRectangle method that force to draw only inside of that rectangle. I don't know big API's such as DirectX and OpenGL, so I don't know analog of this method (it would be great if you point me such method in DirectX). And here my question: does only fragments processed that falls inside this rectangle or all fragments processed anyway. For example, I have big texture 1024x1024 px size with tiny image drawn in the middle of it. Next, I draw this texture to back buffer with some heavy shader and specify scissor rectangle of 20x20 px size. Yes, it works, but I need to know - does GPU process ALL 1024*1024 fragments or 20*20 as I want?
Advertisement
In the open gl pipeline (at least <=2.0) the scissortest is executed after the fragment stage just before alpha/depth test, but drivers will most likely optimize this as long as it does not change the virtual pipeline, a quick test with an expensive shader and 1kx1k vs 20x20 should clearly display the benefit.
Yeah. Made some tests. It seems that ALL fragments processed (. Thank you.
And what about stencil test? When does stencil check occurs?

This topic is closed to new replies.

Advertisement