Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // say you have a 2D map
- // like so
- // X X X X X X
- // X X X X X X
- // X X X X X X
- // X X X X X X
- // X X X X X X
- // X X X X X X
- // you can splitup the map into pieces
- // as many as you see fit, but keep them
- // large, and don't bother sorting them
- // either
- // so now you can have something like
- // X X X X X X
- // X X X X X X
- // X X X X X X
- //
- // X X X X X X
- // X X X X X X
- // X X X X X X
- // you generate 4 VBOs for this since you have _four_ sections
- // these sections can be your PORTALS!
- // lets give them ids 0-3
- // now you have 4 VBOs, it can be 5,6,7,8 does not matter
- // map size can be anything, you just break it down into
- // smaller chunks, that are farily large, but not too
- // large that the portal culling would be useless
- // now you implement yout actual PVS culling
- // for(vbos_in_map)
- // if(camera_is_in_portal_or_visible_to_portal)
- // add_vbo_to_instance_data
- // finally your render it!
- // this way only VBO's you can see or are in
- // will be rendered, everything else will not
Add Comment
Please, Sign In to add comment