tags:

views:

31

answers:

1

I have a viewport setup with orthographic projection. If I ask OpenGL to draw a quad outside of the viewport (x y bounds) using glDrawArrays(), does it ignore, or still draws it?

+2  A: 

opengl will process your vertices (modelview transform etc.) because thats how it figures out where the pixels would end up, but when it comes to actually rendering, it will not 'draw' anything, because the pixel coordinates will not exist in the framebuffer. Depending on exactly where the coordinates are and other factors opengl may be able to stop processing your vertices sooner, but in general it will do all the coordinate transformations at least.

So in a word no, it will not 'draw' them.

luke
Thanks. Sounds like there's room for optimization before the coordinates are passed to OpenGL.
hyn
its very common to specifically calculate visibility of various scene objects before rendering. so this is definitely recommended
luke