Decals (GoldSrc): Difference between revisions
SirYodaJedi (talk | contribs) |
SirYodaJedi (talk | contribs) |
||
(20 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{LanguageBar}} | ||
{{tabs|Decals|goldsrc=1|source=1|main=source}} | |||
{{draft}} | |||
== Infodecal == | == Infodecal == | ||
{{ent|infodecal | {{ent|infodecal|engine=goldsrc}} 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. | ||
{{modernImportant|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.}} | {{modernImportant|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.}} | ||
{{Note|infodecal decals will not show up if r_decals is set to 0 in the Command Console or if decals.wad is not loaded.}} | |||
{{note|Infodecal is also used for dynamic decals, such as: | |||
*Explosion Marks(Grenades,Rockets,Satchel charge,Explosive barrels,Mines,etc) | |||
*Alien blood (Shows if violence_ablood equals 1 and/or content lock is disabled) | |||
*Human blood (Shows if violence_hblood equals 1 and/or content lock is disabled) | |||
*Tau cannon wall mark | |||
*Bullet holes | |||
*Bullsquid acid spit | |||
}} | |||
== Oriented IndexAlpha Sprites == | == Oriented IndexAlpha Sprites == | ||
Line 11: | Line 23: | ||
This can also be used for decals placed on models, which normally cannot have decals, although they won't wrap around geometr | 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.}} | {{placement 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.}} | ||
== Func_illusionary == | |||
{{todo|Using coplanar {{ent|func_illusionary|engine=goldsrc}} with solid rendermode and {{code|origin}} KV with 0.125 or 0.0625 unit offset in applicable direction (ex: {{code|0 0 -0.0625}}.}} | |||
{{important|As brush textures only support alpha testing and not alpha blending (except additive blending), this method is best for decals with sharp edges.}} | |||
== Baking into the WAD or MDL texture == | == 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. | 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 method was used for several textures used by de_dust and de_dust2 in {{cs|2}}. | ||
This also prevents the decal from affecting the number of max [[edicts]], and is [[cheap]]er to render, as it does not require texture blending. | |||
[[Category:GoldSrc]] | |||
[[Category:GoldSrc Glossary]] | |||
[[Category:GoldSrc Textures]] |
Latest revision as of 10:04, 1 April 2025



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.



- Explosion Marks(Grenades,Rockets,Satchel charge,Explosive barrels,Mines,etc)
- Alien blood (Shows if violence_ablood equals 1 and/or content lock is disabled)
- Human blood (Shows if violence_hblood equals 1 and/or content lock is disabled)
- Tau cannon wall mark
- Bullet holes
- Bullsquid acid spit
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


Func_illusionary

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 method was used for several textures used by de_dust and de_dust2 in Counter-Strike.
This also prevents the decal from affecting the number of max edicts, and is cheaper to render, as it does not require texture blending.