PDA

View Full Version : To what extent does OpenGL do occlusion culling?



Matthew4693434
06-27-2010, 01:52 PM
I am making a 2D game. My game has different floors in a top-down view. Floors can have transparent parts so parts of floor beneath will need to be rendered.

I tested getting OpenGL to draw the entire thing. Will it matter if I do that?

I've noticed OpenGL ignores everything outside the viewing area but what about things underneath?

zeoverlord
06-28-2010, 05:38 AM
Depends on how you draw it, if you render each floor from bottom to top then it will be visible otherwise not.



I tested getting OpenGL to draw the entire thing. Will it matter if I do that?

again it depends on how many floors you render, if it's a lot then you might want to limit the amount of floors you render at once to like 5 or 10, though your hardware could probably manage way more than that.

Matthew4693434
06-28-2010, 02:39 PM
Thank you for the reply.

I have 5 floors maximum. You think reasonably modern graphics cards can handle this fine?

mhagain
06-28-2010, 05:24 PM
5 x overdraw shouldn't be too bad in most cases, especially with 2D stuff. Why not mock up a quick and dirty demo that contains nothing but your worst-case rendering code and go try it on a handful of machines? You'll find out if it's OK quickly enough.

Matthew4693434
06-29-2010, 11:49 AM
I can only test it easily on the machine I'm on. I think I'll draw everything and worry about it later if I come to later problems.

Thank you.