Search code examples
c++opengl-esgame-engineclipping

2d game engine clipping algorithms


I'm building a 2d game engine using c++ and opengl. Now i have implemented a scene graph and now every node of this graph is being rendered every frame. What are good algorithms for clipping nodes that are outside the viewport?


Solution

  • at a most simple level, you could use quadtrees for culling, it has the added bonus of being useful for collision detection as well, Wikipedia has a page explaining it.