Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

occlusion culling

Name: Anonymous 2010-09-30 19:20

sup /prog/,

So I'm gonna make myself a isometric game that is built up with cubes so one of the important things to me is occlusion culling when there are a ton of cubes on that screen to be drawn. As of right now i'm making a quick java version for quick deploy and easy access with swing, etc.(Later it'll be ported to either C or C++).

As of right now i kinda have an idea of how i could attack this by rendering 2 frames. Here's how it would work:

1st Frame:
-Rendered from left -> right; front -> back
-As it's rendering it would check each cube based on it's hit box to see if it is covered or partially visible
-If partially visible(or completely) =>Draw cube; add to a Array containing all the cubes that will be drawn in the 2nd frame
-else => Discard that cube and move to the next one

2nd Frame:
Very easy render from right->left; back -> front with all of the cubes that will be visible in that frame.


In theory this method should work if implemented correctly, but my question to /g/ is does anyone know of a simpler more optimized way of doing occlusion culling(without using openGL or restricting myself to DirectX).

Name: Anonymous 2010-09-30 23:39

A good question on /prog/? Real help in the first 3 replies? I found myself checking whether this was a necro thread from 2006.

>>5
I would run pixel checks in the frame to see if something is there or not there.
Isn't this what a depth buffer is for? If you're going to do this, let the video card do it for you. Just render all frames the way you would your "1st frame", except turn on depth test. Problem solved.

This is of course assuming you are sticking with a fixed isometric view, where your environment is very few cubes deep. If this is a Minecraft clone you are going to have a whole lot more problems. >>4 is basically correct here, except instead of making 10x10 packs, I would store it in an octree. You will want all the child nodes of each node depth-sorted, and paint everything front-to-back with a depth buffer, frustrum culling each node as you traverse it... you know the drill. Painting an octree is fairly straightforward.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List