<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.splashdamage.com/index.php?action=history&amp;feed=atom&amp;title=Occlusion_Tests</id>
	<title>Occlusion Tests - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.splashdamage.com/index.php?action=history&amp;feed=atom&amp;title=Occlusion_Tests"/>
	<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Occlusion_Tests&amp;action=history"/>
	<updated>2026-04-07T17:08:47Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=Occlusion_Tests&amp;diff=3344&amp;oldid=prev</id>
		<title>Ducks: Batch update</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Occlusion_Tests&amp;diff=3344&amp;oldid=prev"/>
		<updated>2007-11-21T15:32:06Z</updated>

		<summary type="html">&lt;p&gt;Batch update&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Occlusion testing is another form of optimization that prevents the rendering of entities that are hidden from view (occluded) by other surfaces. By using bounding box data provided by the graphics card in the previous frame, the engine determines whether an entity should be rendered in the next frame. An enlarged entity bounding box is used to do this.&lt;br /&gt;
&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
There are two main ways to specify that an entity should use occlusion tests:&lt;br /&gt;
&lt;br /&gt;
* Material Flag - add &amp;quot;occlusionQuery&amp;quot; to the material definition.&lt;br /&gt;
* LOD Groups - assign the entity to a [[LOD Group]] that has {{keyname|occlusionTest}} set to {{keyvalue|true}}&lt;br /&gt;
&lt;br /&gt;
It is also possible to flag portals as occlusion tested (see [[Common Textures#editor/visportal_occluder|visportal_occluder]]) - this is useful when a portal is difficult to dog leg but is behind opaque geometry.&lt;br /&gt;
&lt;br /&gt;
[[Image:Occlusions salvage.jpg|500px|thumb|left|Rendering occlusion-tested objects in Salvage]]&lt;br /&gt;
This screenshot demonstrates occlusion-tested objects in Salvage, highlighted using the {{consolecmd|r_showOcclusions}} command. Any object subject to occlusion testing is drawn in wireframe, where red indicates that the object failed the last occlusion test. For example, in this screenshot the garage is occluding many objects, such as the truck, and so those objects will not be drawn.&lt;br /&gt;
&lt;br /&gt;
Because occlusion tests use an expanded bounding box, sometimes objects that appear to be occluded are not considered as such by the engine. This can either be ignored, or the object moved further away so its (enlarged and invisible) bounding box does not protrude through. &lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[Image:Occlusions_salvage2.jpg|700px|thumb|none|Bounding box for an occlusion-tested LOD Group on Salvage]]&lt;br /&gt;
This screenshot shows an area in Salvage that has been assigned to the same LOD level and marked as occlusion tested. The engine uses the white bounding box to determine if this area should be drawn in the next frame - if the bounding box is not visible, then it won't draw the LOD Group at all.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
=== Cost ===&lt;br /&gt;
Of course, there is a hidden expense to enabling occlusion queries, since the bounds of the entity has to be rendered (albeit to the z-buffer)&lt;br /&gt;
&lt;br /&gt;
To prevent stalling the hardware, occlusion data can be up to three frames old. In game this can mean an entity will suddenly appear if that entity was not visible in the previous three frames.&lt;br /&gt;
&lt;br /&gt;
== Developer Commands ==&lt;br /&gt;
* {{consolecmd|r_showOcclusions}} - outlines occlusion-tested objects&lt;br /&gt;
* {{consolecmd|r_occlusionBBDebug}} - draws the bounding boxes used for occlusion testing&lt;br /&gt;
&lt;br /&gt;
[[Category:Advanced Level Design]]&lt;/div&gt;</summary>
		<author><name>Ducks</name></author>
		
	</entry>
</feed>