The USSFC is losing hope and losing the war, but the poorly equipped Legion are losing soldiers fast. This is the desperate last struggle of two clashing armies... This is Crimson Crow.

Report RSS Torqials #2 - Cheap Occlusion Culling

The second of maybe many Torque Tutorials - Torqials - to help Torque developers get on the right track. This deals with using a sort of hack to optimize heavy levels.

Posted by on - Basic Mapping/Technical

The second of maybe many Torque Tutorials - Torqials - to help Torque developers get on the right track. This deals with using a sort of hack to optimize heavy levels.

Torque's LOD system has been noted to be not so great. Portals are a nice touch, but always seem to work as well as you want them to. This is really more of a hack than a real method of doing things, but its effective and pretty simple.

Simply put, this is to use the terrain to cull out sections of the map, since the DIF interiors seem to load all objects regardless of how many walls.

This can only work if the level design allows it.

Let put this into an example:


The character, with his vision marked in red, views all these green objects (within the two red 'bars' anyways).


With a DIF interior (Dark green) and terrain (orange-ish) blocking the way, the possible amount of render-able objects is drastically reduced. If you tried to view as many objects at one time in the previous drawing, the game could seriously be impacted. With a terrain wall (The interior just to cover the look), the possible performance hit is drastically reduced.

Lets look at an example of how this can work in-game:


This is not a demanding scene (In fact its a test map!), but the technique has already been applied.
As of this angle, I cannot render both the tunnel area (right) and the roadway to the deeper part of the city (left). Since the view distance is set pretty high, if I was to stand in the deeper part of the tunnel and look towards the deeper part of the city, the system will render both parts of the map.

This can be a problem, so here is the quick fix:


Here is the same scene with DIF shapes only in outlines. If this was to be a little more effective, I could put the same trick in the first inaccessible building on the far left so even a part of the city won't be rendered from here.
The terrain is orange because the orange texture is a stretched 16x16 and does little to the performance.

In a nutshell, this is really a cheap hack. In the long run, it could do wonders for city maps like this, specifically to 'not' render the array of objects you will commonly find in some of our other maps:


Each red dot is an object, and all are being rendered. For Warlord_Evil's machine, this is little to nothing. For my poor old laptop, this is very costly.

Hope this helps!

Post comment Comments
Herr_Alien
Herr_Alien - - 342 comments

Cool beans!
Basically allowing the mapper to decide what gets culled. Similar systems get used by quite a lot of games. Glad to see you guys are using it in yours!

Reply Good karma Bad karma+2 votes
JustDaveIsFine Author
JustDaveIsFine - - 1,545 comments

Only this is a sort of hack of a way to do it!
For right now though it works, so it will be used.

Reply Good karma+1 vote
azultain1999
azultain1999 - - 1,445 comments

i like this engine! can you add a video?

Reply Good karma Bad karma+1 vote
JustDaveIsFine Author
JustDaveIsFine - - 1,545 comments

Videos have been our to-do list for a very long time.
We've been hesitant because we're still lacking in a lot of animations, meaning some of that fancy in-game look is heavily offset by a static gun.

Its ok though, we do have something in the mix.

Reply Good karma+1 vote
azultain1999
azultain1999 - - 1,445 comments

ok

Reply Good karma Bad karma+1 vote
flárátt_ljós
flárátt_ljós - - 38 comments

Never knew this, cool.

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: