Caulk: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
Geep (talk | contribs)
Condense further
Geep (talk | contribs)
Reformat and editing
Line 11: Line 11:


== Other Uses of Caulk ==
== Other Uses of Caulk ==
Other secondary potential uses, of caulk as a texture, are:
Other secondary potential uses, of caulk as a texture, follow.
* to hide unseeable back-surface polygons (tris) of an object for performance - worth the effort only if planning massive cloning of that object;
=== Hiding Unseeable Tris ===
* to avoid z-fighting in certain situations;
Caulk can be used to hide: [[Image:caulk_image.png|200px|thumb|right|Image 1. Caulk applied to a func_static window.]]
* as a mapper convenience tool, namely, one way to make it easy to see into your map from the void, using the built-in DR Caulk filter.
* back-surface polygons (tris) of a ''prop'' object, such as a door or window as in Image 1. There, surfaces touching the wall are caulked, so are not drawn in game, saving tris. Such caulking is worth the effort only if you plan massive cloning of that object;
Expand the section below to read the condensation of an early analysis, with examples, that considered these uses.
* worldspawn brush surfaces entirely covered by detail work like patches.[[Image:caulk_image2.png|200px|thumb|right|Image 2. Caulk applied to a unseeable worldspawn brush surface.]] See Image 2. The player can never see the caulked surface because it's hidden by the func_static vault. This not only saves tris (which is not really important), but also removes the sparkling of the other texture at the highest point of the vault.
=== Avoiding Z-Fighting ===
Caulking helps in certain circumstances, e.g., with a vault as seen in Image 2. The caulked worldspawn surface does not "sparkle" or z-fight through the highest point of the vault, where the vault patch and the worldspawn brush are at equal height.
=== As a DR Mapper Convenience ===
Some mappers like to caulk the exterior surfaces of their maps. [[Image:caulk_image3.png|200px|thumb|right|Image 3. Benefits of caulking as a mapping tool.]] While unnecessary for game play (since the engine does this automatically), it benefits editing. By using the DR Caulk filter, the mapper can easily switch off the exterior surfaces and see inside the map to get a better vantage point. See image 3. The top image shows how mapping works for mapper who do not caulk the exterior. It is difficult to get a good overhead view of the work, and the mapper has to either hide the exterior brushes or fly inside the map. The middle image shows how mapping works for mapper who do caulk the exterior, when the caulk filter is not active. The bottom image show how the mapping works when the caulk filter is activated. The mapper has a superior overhead view into the work.
 
Be aware that similar result can be achieved by non-caulk-user by:
* adding a custom DR "Portal Sky" filter
* using DR Layers.  
 
Expand the section below to read an early analysis that considered the performance impact.
<div class="toccolours mw-collapsible mw-collapsed" style="width:100%; overflow:auto;>
<div class="toccolours mw-collapsible mw-collapsed" style="width:100%; overflow:auto;>


=== Other Caulk Uses - An Analysis with Examples ===
=== Caulking Surfaces to Improve Performance - An Analysis ===
==== Introduction ====
==== Introduction ====
To save a few polygons (tris), one can apply caulk on surfaces the player can never see in any circumstances. Caulking surfaces reduces the amount of tris, and thus improves performance in some cases. See attached image 1 for an example use of caulk. [[Image:caulk_image.png|200px|thumb|right|Image 1. Caulk applied to a func_static window. Note that the surfaces touching the wall are caulked. These surfaces are not drawn in game, saving tris.]] Testing has revealed that the caulking your map does not have a significant impact on performance.
To save a few polygons (tris), one can apply caulk on surfaces the player can never see in any circumstances, for example wall facing surfaces of prop windows and doors. Caulking surfaces reduces the amount of tris, and thus could potentially improve performance in some cases. Image 1 gave an example.  But testing (below) has revealed that such caulking of your map does not have a significant impact on performance.


==== When Not to Use Caulk ====
==== When Not to Use Caulk for Performance ====
There is no need to use ''caulk'' on any of these surfaces:
There is no need to use ''caulk'' on any of these surfaces:


Line 29: Line 39:


The game engine removes these surfaces automatically, so caulk texture is not needed.
The game engine removes these surfaces automatically, so caulk texture is not needed.
==== When to Use Caulk (in Theory) ====
* On func_static surfaces the player will never see, for example wall facing surfaces of prop windows and doors. Caulk can also be applied to worldspawn brush surfaces, which are entirely covered by detail work like patches. See image 2. [[Image:caulk_image2.png|200px|thumb|right|Image 2. Caulk applied to a worldspawn brush, which the player cannot see in any circumstances. See how the surface hidden by the func_static vault is caulked. This not only saves tris, but also removes the sparkling of the other texture at the highest point of the vault.]]
* You can eliminate z-fighting by caulking the other surface. Caulking also helps with vaults as seen in image 2: the caulked worldspawn surface does not "sparkle" or z-fight through the highest point of the vault, where the vault patch and the worldspawn brush are at equal height.


=== The Effect of Caulking on Performance ===
=== The Effect of Caulking on Performance ===
Line 41: Line 47:
Testing indicated that on a rather high-end computer increase of 23000 tris, 75 draws and 2500 shdw reduced the fps count by two. If a window consists of 5 brushes and the wall facing surfaces are caulked, this saves 5 surfaces and thus 10 tris per window. This would mean that 2300 windows should be caulked to get an improvement of 2fps. Basically this shows that caulking does not have much impact on modern hardware. However, on an older piece of hardware the amount of caulking needed for performance effect is lower, but even in this case it should be remembered that 1000 tris is roughly 20% of a single AI character.
Testing indicated that on a rather high-end computer increase of 23000 tris, 75 draws and 2500 shdw reduced the fps count by two. If a window consists of 5 brushes and the wall facing surfaces are caulked, this saves 5 surfaces and thus 10 tris per window. This would mean that 2300 windows should be caulked to get an improvement of 2fps. Basically this shows that caulking does not have much impact on modern hardware. However, on an older piece of hardware the amount of caulking needed for performance effect is lower, but even in this case it should be remembered that 1000 tris is roughly 20% of a single AI character.


=== How Should Caulk be Used? ===
=== How Should Caulk be Used? Perhaps Before Massive Cloning ===
It is not, according to these results, worthwhile to caulk existing maps, or to spend a lot of time caulking. Every saved tris help, of course, so the most beneficial course of action flow would be that the mappers integrate caulking in their ongoing work flow. If the mapper builds a func_static window he is going to clone and put everywhere, it is beneficial to use a few seconds to apply caulk on the source func_static and then get the caulking tris saving effect on all the clones. This does not add much work for the mapper, but will easily help the mapper to save the amount of tris in the range of thousand or two per medium sized scene where the windows and other cloned (but caulked) objects are present.
It is not, according to these results, worthwhile to caulk existing maps, or to spend a lot of time caulking. Every saved tris help, of course, so the most beneficial course of action flow would be that the mappers integrate caulking in their ongoing work flow. If the mapper builds a func_static window he is going to clone and put everywhere, it is beneficial to use a few seconds to apply caulk on the source func_static and then get the caulking tris saving effect on all the clones. This does not add much work for the mapper, but will easily help the mapper to save the amount of tris in the range of thousand or two per medium sized scene where the windows and other cloned (but caulked) objects are present.


Also, some mappers prefer to caulk the exterior surfaces of their maps, even this is absolutely useless because the engine does this automatically. The benefit of this strategy is an editor thing: using the DR caulk filter the mapper can easily switch off the exterior surfaces and view easily inside the map to get a better vantage point. See image 3. The upmost image shows how mapping works for mapper who do not caulk the exterior. It is difficult to get a good overhead view of the work and the mapper has to either hide the exterior brushes or fly inside the map. The middle image shows how mapping works for mapper who do caulk the exterior, when caulk filter not active. The lowest image show how the mapping works when the caulk filter is activated. The mapper has a superior overhead view into his or her work. Similar result could be achieved by non-caulk-user by adding a custom DR "Portal Sky" filter, or by using DR layers. [[Image:caulk_image3.png|200px|thumb|right|Image 3. Showing benefits of caulking as a mapping tool.]]
=== Performance Conclusion ===
 
Mappers should not see extra trouble to get their work caulked since solid performance increases do not occur with the levels of tris saved by caulking. However, thousands of tris can be saved by simple workflow consideration, when working with objects which are cloned in large amounts.
=== Other Uses - Conclusion ===
Mappers should not see extra trouble to get their work caulked since solid performance increases do not occur with the levels of tris saved by caulking. However, thousands of tris can be saved by simple workflow consideration, when working with objects which are cloned in large amounts. Caulking can also be a handy mapping aid.
</div>
</div>


{{editing}}
{{editing}}
[[Category:Mapping Tutorials]]
[[Category:Mapping Tutorials]]

Revision as of 00:00, 12 April 2020

Introduction and Main Uses

The word "caulk" can be used in two senses:

  1. as a texture, which appears magenta in DR, but is not drawn in-game. Like other textures, it can be applied to the faces of brushes (worldspawns), func_statics, and so on.
  2. as a worldspawn brush with the caulk texture applied to one or typically all surfaces.

It is the second meaning in which caulk actually most useful:

  • for sealing areas of your map against the void;
  • for defining and sealing, in conjunction with visportals, individual vis leaf areas of your map. These are important for avoid unnecessary, performance-sucking rendering, and to provide more-plausible sound propagation. For more about this, see Visportals and Sound Propagation: Part 1.

Other transparent "no draw" textures do not have the sealing property that caulk has. Caulk's transparency allows the portalsky to be seen through it, as well as any func_statics that touch your current vis leaf. That means you can cut a func_static house in half with a caulk brush, and still see both sides of it. Using portalsky this would not traditionally be possible. (It now depends on portalsky mode--see [1].)

Other Uses of Caulk

Other secondary potential uses, of caulk as a texture, follow.

Hiding Unseeable Tris

Caulk can be used to hide:

Image 1. Caulk applied to a func_static window.
  • back-surface polygons (tris) of a prop object, such as a door or window as in Image 1. There, surfaces touching the wall are caulked, so are not drawn in game, saving tris. Such caulking is worth the effort only if you plan massive cloning of that object;
  • worldspawn brush surfaces entirely covered by detail work like patches.
    Image 2. Caulk applied to a unseeable worldspawn brush surface.
    See Image 2. The player can never see the caulked surface because it's hidden by the func_static vault. This not only saves tris (which is not really important), but also removes the sparkling of the other texture at the highest point of the vault.

Avoiding Z-Fighting

Caulking helps in certain circumstances, e.g., with a vault as seen in Image 2. The caulked worldspawn surface does not "sparkle" or z-fight through the highest point of the vault, where the vault patch and the worldspawn brush are at equal height.

As a DR Mapper Convenience

Some mappers like to caulk the exterior surfaces of their maps.

Image 3. Benefits of caulking as a mapping tool.

While unnecessary for game play (since the engine does this automatically), it benefits editing. By using the DR Caulk filter, the mapper can easily switch off the exterior surfaces and see inside the map to get a better vantage point. See image 3. The top image shows how mapping works for mapper who do not caulk the exterior. It is difficult to get a good overhead view of the work, and the mapper has to either hide the exterior brushes or fly inside the map. The middle image shows how mapping works for mapper who do caulk the exterior, when the caulk filter is not active. The bottom image show how the mapping works when the caulk filter is activated. The mapper has a superior overhead view into the work.

Be aware that similar result can be achieved by non-caulk-user by:

  • adding a custom DR "Portal Sky" filter
  • using DR Layers.

Expand the section below to read an early analysis that considered the performance impact.

Caulking Surfaces to Improve Performance - An Analysis

Introduction

To save a few polygons (tris), one can apply caulk on surfaces the player can never see in any circumstances, for example wall facing surfaces of prop windows and doors. Caulking surfaces reduces the amount of tris, and thus could potentially improve performance in some cases. Image 1 gave an example. But testing (below) has revealed that such caulking of your map does not have a significant impact on performance.

When Not to Use Caulk for Performance

There is no need to use caulk on any of these surfaces:

  • worldspawn surfaces on the outside of the map in contact with the void
  • worldspawn surfaces that are flush against another surface, for instance the bottom of a brush aligned with the floor

The game engine removes these surfaces automatically, so caulk texture is not needed.

The Effect of Caulking on Performance

Every now and then, caulking rises up in debates: is it useful and beneficial to spend a lot of time caulking and how much caulk is required to get a solid impact on fps rate? Tests performed by Sotha (Link) gave the following results.

Caulking a medium complex scene with tens of windows and other objects (Knighton Manor start) did NOT have any effect on fps counts. Caulking did save roughly 1000 tris, but this is not sufficient to cause any fps improvement. The main benefit of caulking was the decrease of memory usage: 1000 saved tris saved 0.6MB of memory.

Testing indicated that on a rather high-end computer increase of 23000 tris, 75 draws and 2500 shdw reduced the fps count by two. If a window consists of 5 brushes and the wall facing surfaces are caulked, this saves 5 surfaces and thus 10 tris per window. This would mean that 2300 windows should be caulked to get an improvement of 2fps. Basically this shows that caulking does not have much impact on modern hardware. However, on an older piece of hardware the amount of caulking needed for performance effect is lower, but even in this case it should be remembered that 1000 tris is roughly 20% of a single AI character.

How Should Caulk be Used? Perhaps Before Massive Cloning

It is not, according to these results, worthwhile to caulk existing maps, or to spend a lot of time caulking. Every saved tris help, of course, so the most beneficial course of action flow would be that the mappers integrate caulking in their ongoing work flow. If the mapper builds a func_static window he is going to clone and put everywhere, it is beneficial to use a few seconds to apply caulk on the source func_static and then get the caulking tris saving effect on all the clones. This does not add much work for the mapper, but will easily help the mapper to save the amount of tris in the range of thousand or two per medium sized scene where the windows and other cloned (but caulked) objects are present.

Performance Conclusion

Mappers should not see extra trouble to get their work caulked since solid performance increases do not occur with the levels of tris saved by caulking. However, thousands of tris can be saved by simple workflow consideration, when working with objects which are cloned in large amounts.