Game Development Community

Lack of Docs: Occlusion Volumes

by Dmitry Koteroff · in Torque 3D Beginner · 04/08/2011 (3:02 am) · 10 replies

What they do(occlusion culling, suppose?) and how to use them?

#1
04/08/2011 (7:33 am)
Occlusion volumes are still in development. When they are completed, they will be documented.
#2
10/29/2012 (1:57 pm)
Are these working yet? Is there documentation yet?
#3
11/07/2012 (8:56 am)
The docs were never formalized. The best we have (which aren't really that bad) are these videos:

www.youtube.com/watch?v=qGafTe9uvLI
www.youtube.com/watch?v=AFImkRCUDwc&feature=relmfu
#4
11/07/2012 (11:51 am)
Those ARE nice, I've seen them before but they don't deal with Occlusion Volumes, just Zones and Portals. I'm just looking for basic info like do the OV's work as expected now? and if so, what do they actually occlude? Will they occlude forest items? GroundCover? Terrain? etc. We haven't merged to 1.2 yet but will be in the next short while. In the meantime I'm creating some new levels and want to make use of the OV's but they don't really work right in 1.1 Final from what I understand.
#5
11/07/2012 (2:32 pm)
From Engine/T3D/occlusionVolume.cpp:

ConsoleDocClass( OcclusionVolume,
   "@brief An invisible shape that causes objects hidden from view behind it to not be rendered.\n\n"

   "OcclusionVolume is a class for scene optimization.  It's main use is for outdoor spaces where zones "
   "and portals do not help in optimizing scene culling as they almost only make sense for modeling visibility "
   "in indoor scenarios (and for connecting indoor spaces to outdoor spaces).\n\n"

   "During rendering, every object that is fully behind an occluder \n\n"

   "Be aware that occluders add overhead to scene culling.  Only if this overhead is outweighed by the time "
   "saved by not rendering hidden objects, is the occluder actually effective.  Because of this, chose only those "
   "spots for placing occluders where a significant number of objects will be culled from points that the player "
   "will actually be at during the game.\n\n"

   "Like zones and portals, OcclusionVolumes may have a default box shape or a more complex \n\n"

   "@see Scene::maxOccludersPerZone\n"
   "@see Scene::occluderMinWidthPercentage\n"
   "@see Scene::occluderMinHeightPercentage\n"
   "@ingroup enviroMisc"
);

Since a forest object is very large it is highly unlikely to be occluded. A terrain or ground cover object is also unlikely to be occluded due to their size.

If I recall, there were some interesting fiddly bits with shadows of objects that were occluded or partially occluded not rendering correctly but I can't swear to that.
#6
04/09/2013 (8:20 am)
We've now merged to the latest MIT version and the CE version and Occlusion Volumes are still cutting off terrain at various angles. Is that expected behavior or is something else wrong? In the shots below, I'm inside one OV looking back into another one. There's a castle back there that's being occluded well.

Normal view:
www.alterverse.com/terrain_normal.jpg
Looking down slightly:
www.alterverse.com/terrain_cutoff.jpg
Moving slightly closer:
www.alterverse.com/terrain_fullcut.jpg
#7
04/09/2013 (8:23 am)
Aren't Occlusion Volumes used like walls for disabling rendering of objects behind them? Not for going into.
#8
04/09/2013 (8:54 am)
Not sure, I thought they were meant to be used like this, in this level I have 4 OV's. The level is segmented by 3 mountain ranges with OV's in each area, almost touching each other but not. You can kind of see the black outline of each OV. The shots above are from the center OV looking toward the back one. I get similar issues from other various places and angles. I was just under the impression terrain and forests weren't affected by the OV's.
In this picture I show the basic layout of the level.
EDIT: I removed the middle volume and narrowed them down like walls between and the result is the same.
EDIT2: I dropped the height down on them and made them thin like walls and the mountains don't disappear now from that same vantage point. Apparently these zones WILL occlude some forest item trees some of the time and some terrain some of the time and it will be the same every time you go in so it's a matter of tweaking as much as possible, adjusting height and length etc for now I guess.

www.alterverse.com/o_volumes.jpg
#9
04/10/2013 (9:13 am)
What you have there looks more like the intended use of zones. Basically, I think the occlusion volumes were intended to stand as barriers between areas that you wanted separated - so placed in the "spaces" between those boxes you've drawn. And they would indeed occlude terrain, since they are used to help determine visibility and terrain blocks that are not visible are culled.

I can't find Rene's blog/forum/whatever - I just remember he had posted a few videos that sort of showed them (and zones/portals) in action.
#10
04/11/2013 (1:30 pm)
Yeah, I switched to using them like walls. Now that you mention terrain "blocks" I see how and why I'm getting squared off terrain sections being exposed or hidden, that'll help. Move it slightly one way or the other and it looks ok.