Gaming
 

Occlusion and hint brushes

From OpenArena

Note: Hint brushes are workarounds for compiler limitations and should be used with care. While a well placed hint can save a lot of rendering and reduce vis size they will always increase the bsp size. A badly placed or redundant hint brush will lower performance. If you do not see a significant performance increase when placing a hint brush it is properly better to not place it at all.


Hint brushes are brushes placed in maps to give "hints" to the compiler on where to place visibility portals, hence the name.

The easiest way to think about hint brushes is by imaging virtual lines of sight. So here goes a practical example:


This place is having too many hidden tris being rendered.


The player isn't seeing that stair there, but the render is.


Many tris from this big area are being rendered too.


Placed hint brushes like this. That angled slice is matching a virtual line of sight of a player standing in one of the corridor's edges or the other.


The hint brushes forced q3map2 to generate visibility portals like this.


Now when a player is standing here, behind that portal, looking at the wall and not seeing the stairs that are up ahead...


This is the result: much fewer tris behind the wall being rendered.


An alernative line of sight.

image:hintbrush_view_alternative.png


Portal view, the new line of sight. But the older line is still there, because there is still a hint brush with an angled face following that line.

image:portal_view_alternative.png


Now if the player stands in this place the render shouldn't see the stairs. In comparison to the older line of sight, the new one provides some extra few steps that the player can walk farther on without having those stairs rendered.

image:portal_view_alternative2.png


In a place like this many virtual lines of sight cross each other. Well, what has been done here was a lot of clipped hint brushes... Overlapping is bad because then a lot of small, unecessary clusters, are created between the intersections.

image:portal_view_crosses.png

[edit] More examples, but without map screenshots

image:hint_concept0.png

Hint brushes does not need to be a block that fills up the whole area, the hint brush faces facing the walls and floors are automatically culled. They can be thin, like that, the red lines are skip, the green lines the hint face.


image:hint_concept1.png

In places like this there is a lot of possible hint faces.


image:hint_concept2.png||image:hint_concept3.png||image:hint_concept4.png||image:hint_concept5.png

Red is the player. Green line the hint face. Green area the are that shouldn't be rendered. As long as the player is "behind" (depends on the point of view) the line, that area is culled.

Note: there is a drawback in this situation. If there are simple too many angles from which a player can see one or more areas, it becomes less and less efficient to place that many hint portals.

image:hint_concept6.png

All those lines can be used at the same time. The hint faces can cross each other. As long as the hint face goes from one extreme to the other and/or from floor to ceiling, it should work well.

image:hint_concept7.pngimage:hint_concept8.png

Both ways are possible to place hints on this situation: a hole on the ground or on the ceiling, top is above floor, bottom is below floor.

image:hint_concept9.png

Another way would be this, there are walls that prevent the players from actually seeing the hole. Notice that now the green lines are horizontal, because as long as the player is "under" it (depending on the point of view), that wall will block the visibility of the other floor.

[edit] Tutorials

http://www.wemakemaps.com/hintbrushes.htm

http://www.nibsworld.com/rtcw/tutorial_detail_and_hint_brushes_part1.shtml

http://www.wolfensteinx.com/surface/tutorials/hint_brushes.html