Common materials

From Unvanquished
Jump to: navigation, search

Common materials or common shaders (as they were named in the 90's) are a set of generic surface materials used on brushes where creating. Their purpose is not aesthetic but technical.

Most common materials are only rendered in the level editor, only for you to know when they are used and where when editing a map. Many of those materials are never meant to be rendered in gamer.

Those are not materials looking like some textures, they give instructions to the map compiler, the renderer and even some gameplay code.

Caulking materials

Caulk material

The common/caulk material is solid and invisible. It is perfect for outside faces of brushes that are never meant to be seen.

A surface wearing the caulk material is not just fully translucent, it's entirely skipped.

Sky caulk material

The common/skycaulk material is like the common/caulk one: solid and invisible. But it is also not drawn on minimaps. Its purpose is to be used on invisible faces of skyboxes: this way the minimap only show the actual geometry of the area seen in game, instead of being polluted by brushes drawing the sky.

The skycaulk material was introduced in Unvanquished 0.56.

What is caulking and why caulking?

Caulking is the process of sealing a room. For a map to be valid, there should be no way for an entity to reach the “void”, so an entity should always be placed within walls, roof and floors made of structural brushes.

But then, all sides of brushes don't have to actually wear an actual texture, as many of those brush sides will never be seen, especially the sides that are only visible from outside of the map, or stuck within geometry.

Only the level editor is expected to render a caulk material, so you know a caulk is applied on a surface when you're editing a map, but you also know it is never rendered in game.

Caulking also saves on lightmap baking time and storage spaces: faces of detail brushes (non structural brushes) are always “seen” by the map compiler, and the renderer and the game code, and then may not only be rendered by the game engine even when fully hidden by something, but a light map tile may be generated for them.

The map compiler detects some trivial unseen brushes faces and filter them out, but there are cases where outside brush faces can still be rendered, and a whole brush face will be rendered if a single pixel of it is visible from inside the gameplay area. So if the outside face of a corridor becomes the inside face of a corner in a room, the whole outside face will be rendered, and the lightmap tile for that tiny corner will have the size of the whole brush face, uncluding the outside and unseen part. When a single brush can technically be used both outside and inside at the same time, it is recommended to split the geometry in two brushes, one with a caulked face when the face is outside, one with a textured face when the face is inside.

In NetRadiant preferences window, in Settings/Brush, it is recommended to enable the “Always use caulk for new brushes” option so every newly created brush is made of caulk. This way you only have to paint the visible sides with actual textures, instead of painting all the invisible sides with caulk. With a simple cubic room made of 6 brushes, it would make you paint the 6 inner faces of brushes with actual textures instead of painting the 30 invisible brushes faces with caulk.

Clipping materials

Outside material

The common/outside material is to be used on brush to close open-sky areas. This material is fully transparent, solid, disables wallwalking (is slick) and disables building on it, but let weapon projectile pass. This ca, be placed between a skybox brush and the playable area.

Full clip material

The common/fullclip material is transparent makes the brush solid for everything: player can't go through, weapon projectiles cannot either, it's wall-walkable and buildables can be placed on it.

Functionally, common/fullclip behaves the same as common/nodraw, but the semantic is different. Mappers prefer to use fullclip on sides that faces the playable area to explicitly delimit the playable area (and mark them as such to other contributors), while nodraw is usually applied on invisible faces because it's just meant to not be rendered for whatever reasons.

Metal clip material

The common/fullclip material is the same as the common/fullclip material, except walking on it does metal step sounds. Can be used to add metal step sound effects in one go on large surface mixing various materials or to add such sound effect without editing a material that doesn't have the metalstep property, by layering the metalclip material on an existing surface.

Slick player clip material

The common/slickplayerclip material is fully transparent, solid, and disables wallwalking (is slick). It doesn't disable building on the brush. This is like common/outside except one can build on it.

Hinting materials

🚧️ TODO:
common/hint
common/hintskip
common/subtlehint

Alphagen terrain materials

🚧️ TODO:
common/alpha_000
common/alpha_025
common/alpha_050
common/alpha_075
common/alpha_085
common/alpha_100

Gameplay materials

Cushion material

The common/cushion material is invisible but solid. When landing on a surface using this material, the player will not suffer from any fall damage.

Brushes using this invisible material can be placed on special places players can fall on or jump to but the gameplay mandates they should not take any damage or die.

No drop material

When dying on the common/nodrop material (for example by falling down on it), nothing is left from the player. It is useful to put a nodrop brush at the bottom of pits to avoid dead players corpses accumulating, especially when the bottom of the pit is just the infinite space… The nodrop material is invisible.

No build material

The common/nobuild material applied on faces of a brush makes the brush invisible and traversable (non-solid) while preventing any player to build something inside that brush. This can be used to forbid building in some areas.

No alien/human build material

The common/noalienbuild and common/nohumanbuild variants do the same as common/nobuild but only forbid building for a specific team (Aliens, or Humans) while letting the other team build.

Ladder material

A brush using the common/ladder material makes it invisible, non-solid, and make players able to climb. Such invisible brushes are meant to be placed around actual geometries depicting a ladder or any climbable element.

Slick material

The common/slick material has no friction. Players walking on a surface wearing a slick material just slide on it. Wall-walking classes cannot wall-walk on a slick surface, so the slick material can be used on walls or ceiling to prevent aliens to wall-walk there.

Portal materials

🚧️ TODO:
common/mirror
common/portal

Transparent materials

No draw material

The common/nodraw material is fully transparent and is entirely completely skipped from any rendering, but makes the surface solid.

No draw non solid material

The common/nodrawnonsolid material does the same as common/nodraw but is traversable.

Invisible material

The {code|common/invisible}} material is fully transparent and solid like the common/nodraw one but casts shadows.

To be documented

🚧️ TODO:
common/areaportal
common/black
common/botclip
common/donotenter
common/lightgrid
common/origin
common/terrain
common/terrain_dust
common/trigger