Decals (GoldSrc): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎Oriented IndexAlpha Sprites: rename section for clarity)
Line 9: Line 9:
[[SPR|Sprites]] have an oft-neglected texture format, called IndexAlpha, which provides 8-bit alpha translucency, resulting in an effect similar to decals. These are useful for simulating hard shadows "cast" from models, and can also be used instead of infodecal to allow custom decals in multiplayer maps, as well as to more reliably place a decal in a specific location. This also allows for scaling the decal, as sprites can use an arbitrary scale, instead of being restricted to the brush texel size.
[[SPR|Sprites]] have an oft-neglected texture format, called IndexAlpha, which provides 8-bit alpha translucency, resulting in an effect similar to decals. These are useful for simulating hard shadows "cast" from models, and can also be used instead of infodecal to allow custom decals in multiplayer maps, as well as to more reliably place a decal in a specific location. This also allows for scaling the decal, as sprites can use an arbitrary scale, instead of being restricted to the brush texel size.


This can also be used for decals placed on models, which normally cannot have decals.
This can also be used for decals placed on models, which normally cannot have decals, although they won't wrap around geometr
{{modernImportant|As sprites are unlit, the color of the sprite entity should be set carefully to avoid it appearing to "glow" in dark places.}}
{{modernImportant|As sprites are unlit, the color of the sprite entity should be set carefully to avoid it appearing to "glow" in dark places.}}
{{tip|This method works best on flat surfaces, as angled surfaces would give away the illusion due to not clipping to or wrapping around geometry.}}


== Baking into the WAD or MDL texture ==
== Baking into the WAD or MDL texture ==

Revision as of 22:34, 3 January 2024

English (en)Translate (Translate)
Icon-under construction-blue.png
This is a draft page. It is a work in progress open to editing by anyone.
Remember to check for any notes left by the tagger at this article's talk page.

Infodecal

infodecal can be used to display decals from decals.wad. This is generally the easiest way to place a decal, however it can be finicky where a decal needs to be placed on the grid in comparison to the brush. Additionally, infodecals can sometimes shift around when reloading a map, and may disappear if enough code-generated decals (such as bullet decals) are spawned.

Icon-Important.pngImportant:A major limitation with this method is that non-vanilla decals cannot be used when mapping for an existing multiplayer game. Infodecals must come from decals.wad; textures from other WADs or inside the BSP cannot be used.

Oriented IndexAlpha Sprites

Sprites have an oft-neglected texture format, called IndexAlpha, which provides 8-bit alpha translucency, resulting in an effect similar to decals. These are useful for simulating hard shadows "cast" from models, and can also be used instead of infodecal to allow custom decals in multiplayer maps, as well as to more reliably place a decal in a specific location. This also allows for scaling the decal, as sprites can use an arbitrary scale, instead of being restricted to the brush texel size.

This can also be used for decals placed on models, which normally cannot have decals, although they won't wrap around geometr

Icon-Important.pngImportant:As sprites are unlit, the color of the sprite entity should be set carefully to avoid it appearing to "glow" in dark places.
Tip.pngTip:This method works best on flat surfaces, as angled surfaces would give away the illusion due to not clipping to or wrapping around geometry.

Baking into the WAD or MDL texture

Normally, decals need to be a single color. This can be worked around by simply creating a duplicate version of the texture that would normally house the decal, but with the decal drawn directly onto the texture.

This also prevents the decal from affecting the number of max edicts, and is cheaper to render.