View Full Version : Rendering around camera or level based

05-31-2014, 10:34 AM
I have one thing to ask. I know that there is something like drawing distance in OpenGL but is that enough when creating a large game maps?
I mean I would like to make a huge game environment but of course make it somehow playable :D. For example render only the part around the camera or split the level to some renderable areas and render only the parts which are near or something.
I don't know how moder games handle this, I remember only some old mechanisms form the old ones but what is the best approach for a large map rendering? I have programmed only a small levels where I rendered normally everything at once so far.
Could you please give me some tips or redirect me to some tutorials? I don't know where to start with this. I have some ideas but are there some common ways or algorithms to solve this?
Many thanks and have a nice day ^^

Agent D
06-01-2014, 03:11 AM
This is quite a huge topic.

Modern games normally organize their map geometry in visibility graphs or trees to determine visible areas at runtime, so the don't waste resources rendering things that can't be seen anyway.

There's a large amount of different algorithms for different scenarios, depending on whether you want to render indoor or outdoor scenes or how dynamically updatable the map geometry has to be.

You might want to take a look at one of the following things:

BSP Trees (https://en.wikipedia.org/wiki/Bsp_tree) (good for indoor scenes, computed offline, used by the Quake engine, the Source Engine and other Quake descendants)
Octrees (https://en.wikipedia.org/wiki/Octree) (Easy to implement, also dynamically, some rendering engines like Ogre3D or Irrlicht implement these)
Portal Based rendering (https://en.wikipedia.org/wiki/Portal_rendering) (good for indoor scenes, easy to implement, scene is divided in rooms that are connected via portals)

This is just what came to my mind when I briefly read your post. There are hundreds of approaches, also some that are trying to take advantage of modern GPUs (like "instance cloud culling").

Since there is AFAIK no one ideal solution for everything, you might have to compromise on what types of scenes you want to render.

06-01-2014, 03:34 AM
This is quite a huge topic....

Many thanks, I will check that out ^^