Natural Selection 2 is the sequel to the popular Half-Life mod Natural Selection. It is built on our own engine and will be distributed through Valve's Steam platform.

Report content RSS feed Occlusion Culling

On of the important tasks in a first person engine is occlusion culling. Occlusion culling is the process of discarding elements of the world that aren't going to contribute to the final rendered scene so that you don't spend CPU and GPU time processing them. With expensive elements like dynamic lighting and shadows, this becomes especially important.

Posted by TychoCelchuuu on Mar 5th, 2009

Here's a Natural Selection 1 level rendered in our engine:

Even with the textures missing, some of you will probably recognize this spot. While this may look like a simple hallway, to the rendering engine it looks a lot more complicated. Here's the same scene rendered in wireframe mode:

As you can see, there's lots of stuff behind those walls that's being rendered, but which we don't actually see. In many first person engines this problem is solved by precomputing information throughout the level about what's visible; this is known as a potentially visible set (PVS).

If you've ever done any mapping for the Quake or Half-Life engines, you're probably familiar with the "vis" tool which performs this precomputation. This can be a slow process that requires a lot of tweaking and careful modeling. Because the data is precomputed, the environment can't change much at run-time. And finally the PVS method is not very good when it comes to outdoor scenes. To alleviate all of these problems, we've chosen to use a hardware assisted occlusion culling method that doesn't require precomputation.

Here's what the scene looks like with the occlusion culling system enabled:

As expected, most of the invisible geometry has been discarded during the rendering process. Because of way the algorithm utilizes the graphics card, the structure of the level doesn't really affect the system. It works with outdoor environments as well as indoor environments and can handle polygons "soups" -- collections of polygons that don't really have any structure at all.

While real-time occlusion culling has some additional performance cost over precomputed systems like PVS, we think the benefits more than make up for it. And with clever optimizations, that cost can be reduced substantially.

For those that are technical minded and would like to learn more occlusion culling, our system is an implementation of the CHC++ algorithm (paper available online here).
Comment on this

Post comment Comments
Spector Mar 5 2009 says:

Good stuff. Always good to know that good optimizations are being implemented. Maybe my computer will run this at a decent frame rate. =O

+14 votes     reply to comment
SandeR2 Mar 6 2009 replied:

oops omg sorry Spector i accidently [-] your post instead of [+] please forgive me....

+3 votes     reply to comment
RogerRamjet Mar 5 2009 says:

Nice, it is always a good thing to know info like this... go NS2...

+4 votes     reply to comment
SweetPoison42 Mar 6 2009 says:

Very Nice! I always say great occlusion culling makes a great levels. Great to see you guys go as far as making your own tools. Looking froward to NS2.

+4 votes     reply to comment
Setis Mar 6 2009 says:

looking great, as was expected from you guys! :D What you guys have done with the occlusion culling sounds fantastic already. Really can't wait to see this in action. You should release a video of running through the level in wireframe! :)

Looking forward to more news!

+1 vote     reply to comment
SinKing Mar 6 2009 says:

Haven't you been making Natural Selection 2 forever? Why do we get this very basic info, isn't there anything more interesting to see, yet?

I really wonder what's gonna come out of NS2, as the first part was a great game, but time doesn't go easy on old concepts. Better hurry up a little, or you will be dead on release.

-1 votes     reply to comment
Dragonlord Mar 6 2009 says:

Using the Occlusion Test Extension ( don't know how this is called in DirectX ) it looks like. The performance hits comes from the feedback nature of this system ( reading back infos from the graphic card stalls the render pipeline ). I'm a bit astonished this should yield alone a speed up since many tests showed so far that relying on HW-Occlusion testing alone won't gain anything. Some profiling numbers you can produce? Just curious to know since my numbers support the stance towards HW-Occlusion being slower.

+1 vote     reply to comment
f0rqu3 Mar 6 2009 says:

great after months you came with occlusion culling???
isn't news supposed to be about the game?

-3 votes     reply to comment
Harimau Mar 6 2009 replied:

hey genius. it's about the game engine. you need a game engine to make a game.
...have you made the connection yet?

+2 votes     reply to comment
f0rqu3 Mar 7 2009 replied:

umm lol of course you need an engine but adding occlusion culling to your engine and thinking it is a ground breaking feature is priceless. nowadays it is like "hey look I added 3d rendering"
anyway sorry for not being a natural selection fan.

0 votes     reply to comment
hushpuppy Mar 6 2009 says:

Yeh it sure is good with optimizaton, but this isnt really anything revolutionary? :S I mean, most mappers know this stuff xD

+2 votes     reply to comment
f0rqu3 Mar 6 2009 replied:

probably they have nothing else good to show

0 votes     reply to comment
Relto Mar 7 2009 replied:

Mappers know its there. They don't know how it works.

+1 vote     reply to comment
Harimau Mar 7 2009 says:

ah right, and just so you know, progress IS getting done, they're just being very careful about releasing media, particularly when it comes to art direction or game design decisions. updates on the technical side just happen to be the 'safest'.

how you know there is progress: follow their twitter for most recent updates - - the team updates it very often.
and there's a discussion thread for the twitter updates here so register if you wanna chime in.

+1 vote     reply to comment
_Xero_ Mar 17 2009 replied:

I think Harimau summed it up best. I know that to many people, occlusion culling isn't the most exciting news. However, the team is being very tight on their juciest info. This is on purpose, not for a lack of interesting news. StarCraft 2 is about to go beta, and there are things people didn't know for a while, and other things are still changing every day. Does that mean SC2 was boring and/or early in development? No, it simply means that the developers wished to keep a tight lid on what is sure to be a killer game. This goes for NS2 as well.

+1 vote     reply to comment
TyeTheCzar Mar 9 2009 says:

Just like everyone here, thanks. I love to see really good explanations such as yours on how the game is made. I'd love to see this kind of thing from most developers.

+1 vote     reply to comment
Post a comment

You are not logged in, your comment will be anonymous unless you join the community. Or sign in with your social account:

Natural Selection 2
Windows, Linux
Unknown Worlds
Send Message
Release date
Released 2012
Game watch
Start tracking
Related Games
Natural Selection 2
Natural Selection 2 Real Time Shooter
Related Engines
Spark Commercial TBD
Related Groups
Unknown Worlds
Unknown Worlds Developer & Publisher with 8 members