Sign in to follow this  
ic0de

Frustrum Culling help

Recommended Posts

ic0de    1012
hi
I have sort of implemented frustum culling, I can test points against the frustum but I haven't been able to eliminate that much geometry, my world is stored in a VBO, which is generated from a world structure containing vertices in sequential order and some other stuff. Basically I cant figure out a way that it makes sense to regenerate my VBO every frame so that I can knock off some vertices. For the moment I have simply been testing world objects, like enemies and items and leaving the world alone. Is there a way to cull the world without regenerating the VBO every time?

Share this post


Link to post
Share on other sites
dpadam450    2357
You don't cull vertices, you cull objects. So for instance terrain, cut it into a grid of chunks and cull chunks of the terrain. If you have a barrel in your world, it should go into 1 vbo and draw that vbo over and over, then you can cull all of the barrels. So: Never cull triangles, only objects. Never update VBO's every frame, the point of them is so that you load once and never touch again.

Share this post


Link to post
Share on other sites
ic0de    1012
[quote name='dpadam450' timestamp='1329606925' post='4914335'] You don't cull vertices, you cull objects. So for instance terrain, cut it into a grid of chunks and cull chunks of the terrain. If you have a barrel in your world, it should go into 1 vbo and draw that vbo over and over, then you can cull all of the barrels. So: Never cull triangles, only objects. Never update VBO's every frame, the point of them is so that you load once and never touch again. [/quote]

do I need to modify the file structure I use to store the map or can I automatically subdivide it at load time

Share this post


Link to post
Share on other sites
SuperVGA    1132
Hi ic0de,

Yes, you can subdivide at load and then push as many vbos as possible to your card as few times as possible.
Then tell it which ones to render as what your frustrum culling procedure returned.
It's ususally recommended to subdivide into a tree. K-D, Quad or Octree, depending on the density and uniformity of your scene.

But like dpadam said, create some chunks consisting of data inside a cullable region (such as an axis-aligned cube),
and create vbos for every chunk.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this