0
\$\begingroup\$

So I have a bounding volume tree, almost an octree but not quite.

Anyway I'm trying to optimize my drawing, right now I have a few different culling frustums that I use to cull different ranges of the BV tree, its very fast, I can pull all my world data in less than 1ms but when it comes to culling the grass and the other mesh data I'm thinking that because I have lots of mountains and hill that I'm rendering stuff that is inside the frustum but occluded but hills and mountains.

What would be the right way to cull this? Should I do a ray cast against my terrain from each corner of the bounding boxes to the player and cull anything that gets a hit? or should I find some fancy way to do it on the GPU?.

I only have to test maybe 1k boxes x 8 corners, so the ray casting shouldn't take to long.

\$\endgroup\$
1
\$\begingroup\$

Ok so after a few days of tinkering I found out that ray casting that much against my terrain is bad and slow, part of it is because the physics in run on another thread so syncing is hard and there was just way to much data so now I have setup some predicate query's and so far so good.

It works like this:

Fill Gbuffer-> Do predicate query's using the bounding boxes from the frustum culled tree nodes-> Finish the frame-> Check if query's are done, if not then just draw the next frame as normal but if they are then on the next cpu update I use the returned predicate values when I cull the visible tree nodes.

The predicate query's run a few frames behind but that's ok as I only update the visible mesh data every 6 frames and I have it set so it only uses the predicate culling after as certain distance so it hides the lag well.

I was running at 45-75 FPS with an average of 55 FPS but now I'm at 65-90 FPS with an average of 78 FPS so its culling out lots of data.

I have a few things to ask about predication but ill start a new question for that.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.