Clip texture: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (links to list of clip textures)
(Revised page. Moved some text. Added some general information about clip brushes and their properties. Added idea to create an own tool texture with desired $surfaceprop. playerclip is ignored in nav generation.)
Line 1: Line 1:
{{LanguageBar}}
{{LanguageBar}}
''For a list of clip textures, go [[Tool_textures_(Source)#Clips|here]]''
''For a list of clip textures, see [[Tool textures (Source)#Clips]].''


''[[Tool textures#Clips|Clip]] textures'' are invisible [[tool texture]]s that limit movement, typically of the player(s). A [[brush]] used with a '''clip texture''' is generally termed a ''clip brush''. In the [[Source]] engine, the general dedicated clip texture is ''Clip'', but alternatives are ''Player Clip'', ''(Player) Control Clip'' and ''NPC Clip''. These all share the same ''Clips'' [[VisGroup]] category.  However, any unrendered brush or model can fill this role.
'''Clip textures''' are invisible [[tool texture]]s that limit movement, typically of the player(s). A [[brush]] used with a '''clip texture''' is generally termed a ''clip brush''. However, any unrendered brush or model can fill this role.


== The practice of constraining the player ==
[[File:PlayerClip use example.png|thumb|right|200px|A fence surrounded by both a <code>playerclip</code> and <code>[[Line of sight|blocklos]]</code> brush]]
There are good techniques and there are bad techniques when it comes to using clip brushes to limit the player's movement.
There are good techniques and there are bad techniques when it comes to using clip brushes to limit the player's movement.


''Good'' techniques are the ones that keep the player away from possibly getting entangled and stuck in complicated brushwork such as in between a tree and a hill, or amidst the cracks of several rocks, forcing the player to restart. However, wedge-shaped clip brushes can also be used to prevent the player from getting stuck on small detail brushes like window sills or buttons while trying to run somewhere, and to prevent the player from jumping up on top of an all too narrow fence or window sill.
''Good'' techniques are the ones that keep the player away from possibly getting entangled and stuck in complicated brushwork such as in between a tree and a hill, or amidst the cracks of several rocks, forcing the player to restart. However, wedge-shaped clip brushes can also be used to prevent the player from getting stuck on small detail brushes like window sills or buttons while trying to run somewhere, and to prevent the player from jumping up on top of an all too narrow fence or window sill.


''Bad'' techniques are known as [[Wikipedia:invisible wall|invisible walls]], that block the player from heading into a corridor that they are not "supposed" to enter. Apart from frustrating the player, this breaks down the illusion of an immersive world and reminds the player this is just a game. Instead, try designing visible blocks like furniture, rubble or locked doors. If this is necessary, use a visible warning to indicate to the player that this is not the correct way ahead. In {{l4d2|4}}, there is a model named "wrongway_sign01" that is used in Dark Carnival to stop players from entering a small room where infected spawn.  
''Bad'' techniques are known as [[Wikipedia:invisible wall|invisible walls]], that block the player from heading into a corridor that they are not "supposed" to enter. Apart from frustrating the player, this breaks down the illusion of an immersive world and reminds the player this is just a game. Instead, try designing visible blocks like furniture, rubble or locked doors. If this is necessary, use a visible warning to indicate to the player that this is not the correct way ahead. In {{l4d2|4}}, there is a texture named <code>[[Tool textures (Source)#wrongway|wrongway_sign01]]</code> that is used in ''Dark Carnival'' to stop players from entering a small room where infected spawn.


== Example ==
=== Example ===
[[File:PlayerClip use example.png|right|200px]]
The fence on the right is enveloped by a ''toolsplayerclip'' tool texture for two reasons: First of all it prevents the player from getting caught on the brushwork when running alongside it, and second of all it prevents the player from jumping over something that would be at least cumbersome to climb over in real life. Be aware that the player could acquire physics objects and pile them up against the fence, and through this jump over the brush. If this is the case, you could consider extending this clip brush all the way to the roof of the map, but as this would create an ''invisible wall'', it would perhaps be better to replace the entire fence with a solid wall instead.
 
== Using clips ==
=== Available clip textures ===
In the {{src|4}} engine, the general dedicated clip texture is ''Clip'', but alternatives are ''Player Clip'', ''(Player) Control Clip'' and ''NPC Clip''. These all share the same ''Clips'' [[VisGroup]] category.
{{clr}}
{| rules="all" cellpadding="5" style="border:1px solid #555; background:#2D2D2D;"
|- style="background:#333; color:#DDD"
! width="56px" | Texture
! width="56px" | Solid to [[player]]s
! width="56px" | Solid to [[NPC]]s
! width="60px" | Solid to [[bot]]s
! width="60px" | Solid for [[Nav Mesh]]
! width="56px" | Solid to [[weapon_c4|C4]] {{css}}{{csgo}}
! width="56px" | Solid to [[hostage_entity|hostages]]
! Usage / Notes
|- id="clip"
| style="text-align:center; font-family:monospace, monospace" | [[File:Toolsclip.gif|64px]] <br> toolsclip
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Both|{{css}} Yes<br>{{csgo}} No}}
|
It intentionally is not solid to bullets or physics, it does not cast shadows and it is transparent, for both players as well as NPCs or bots. Thus, it does not cut [[visleaf]]s.


The texture is generally intended to be used on all sides of a world brush. It already gets all the aforementioned properties through its {{cmd|%compileclip}} compile flag and does not need to be tied to an entity and is not subject to optimization with {{ent|func_detail}}. The same applies to Player clip and NPC clip, just that they are only solid to either players or NPCs respectively, and not to both.


The fence on the right is enveloped by a ''toolsplayerclip'' tool texture for two reasons: First of all it prevents the player from getting caught on the brushwork when running alongside it, and second of all it prevents the player from jumping over something that would be at least cumbersome to climb over in real life. Be aware that the player could acquire physics objects and pile them up against the fence, and through this jump over the brush. If this is the case, you could consider extending this clip brush all the way to the roof of the map, but as this would create an ''invisible wall'', it would perhaps be better to replace the entire fence with a solid wall instead.
It is the most general clip texture to use, for example to clip level bounds with vertical walls or to simplify the collisions of props, the floor or other complex geometry.
|- id="playerclip"
| style="text-align:center; font-family:monospace, monospace" | [[File:Toolsplayerclip.gif|64px]] <br> toolsplayerclip
| {{Yes}}
| {{No}}
| {{Yes}}
| {{No}}
| {{Yes}}
| {{Both|{{css}} Yes<br>{{csgo}} No}}
|
{{l4ds}} Solid to the survivors only.
{{warning|Brushes with this texture are ignored by the [[Nav Mesh|nav mesh]] generation, which affects multiplayer games with [[bot]]s. Use the red clip texture instead, especially to block out the level and to clip floors and props, otherwise the game is prone to generate areas that are unreachable, malformed or simply missing.}}
|- id="npcclip"
| style="text-align:center; font-family:monospace, monospace" | [[File:Toolsnpcclip.gif|64px]] <br> toolsnpcclip
| {{No}}
| {{Yes}}
| {{Both|{{css}}{{csgo}}{{cs2}}Yes<br>{{l4ds}}{{tf2}}No}}
| {{Yes}}
| {{No}}
| {{No}}
|
{{l4ds}} Solid to infected only, but does not stop Smokers, Boomers and Spitters from attacking through it.
|}
 
===Clipping physics===
The entity {{ent|func_clip_vphysics}} is used to clip only physics objects like dropped weapons etc. Create a clip or nodraw brush and tie it to an entity of the aforementioned class. This means that if both players and physics should be clipped, you need two brushes inside each other, for example a clip world brush and a copy of it tied to a <code>func_clip_vphysics</code> entity.


== Alternatives ==
===Invisible Displacement===
===Invisible Displacement===
[[File:L4d1_displacement_clip_alternative.png|right|200px|thumb|Alternative invisible displacement, for when clip brushes are too difficult to create.]]
[[File:L4d1_displacement_clip_alternative.png|right|200px|thumb|Alternative invisible displacement, for when clip brushes are too difficult to create.]]
Line 27: Line 79:


===Clips with Surfaceprop===
===Clips with Surfaceprop===
Some games, like {{csgo|3}} and {{Gmod|3}}, have multiple clip tool textures that use specific [[material surface properties]], such as concrete, dirt, glass, ect.<br>
One issue with the generic red clip texture is that it inherits the default {{cmd|$surfaceprop}} which plays concrete footsteps when walked on. This is why some games, like {{csgo|1}} and {{Gmod|1}}, have multiple red clip tool textures that use specific [[material surface properties]], such as concrete, dirt, glass, etc. This allows the clips to sound different when stepping upon and also make use of the surface properties, like the very low friction of "SlipperySlide". Example uses of this is utilizing glass clips when working on glass catwalks, which would allow you to still hear glass noises when stepping onto the clip, whereas the generic clip texture would otherwise play a default concrete sound which would be out of place.
This allows the clips to sound different when stepping upon and also make use of the materials properties, like the very low friction of "SlipperySlide".<br>
Example uses of this is utilizing clips with glass material when working on glass catwalks, which would allow you to still hear glass noises when stepping onto the clip, as it would otherwise play a generic sound which would be out of place.<br>
For games that do not have these clip textures, you could create your own or copy them from a game that has them. But that may not work in some games, as it will cause every single clip to use the surfaceprop of whichever clip your first interacted with. {{l4d2|3}} for example causes this sound bug to occur.


Alternatively, you can ([[expensive|with more overhead]]) use the following workaround to avoid creating new material files:
For games that do not have these clip textures, you could create your own or copy them from a game that has them. But that may not work in some games, as it will cause every single clip to use the surfaceprop of whichever clip your first interacted with. {{l4d2|1}} for example causes this sound bug to occur.
# Build your brushwork for the clip using any texture that posesses the material properties you require. For example, <code>glass/glasswindow007a</code>, simply because it is glass.
# Turn the brushwork into a [[func brush]] that is set to "Don't Render", "Always Solid", and "Solid BSP". This stops your brush from cutting [[Visleaf|Vis Leaves]] and becomes invisible, just like a clip brush would.  
{{warning|Depending on thickness, it will also block bullets. It will also block [[prop physics|physical props]] and projectile weapons, such as grenades, or [[tf projectile arrow|arrows]], because it is merely invisible brushwork.}}


{{clr}}
Alternatively, you can ([[expensive|with more overhead]]) use the following workaround to avoid creating new material files: Build your brushwork for the clip using any texture that possesses the material properties you require. For example, <code>glass/glasswindow007a</code>, simply because it is glass. Turn the brushwork into a {{ent|func_brush}} that is set to "Don't Render", "Always Solid", and "Solid BSP". This stops your brush from cutting [[Visleaf|Vis Leaves]] and becomes invisible, just like a clip brush would. However, depending on thickness, it will also block bullets and also [[prop physics|physical props]] and projectile weapons, such as grenades, or [[tf projectile arrow|arrows]], because it is merely invisible brushwork.
 
You can also create your own material. For example, to get a wooden clip material, create a new text file {{path|<game>/materials/tools/toolsclip_wood|vmt}}, reuse the clip texture (or create your own to be able to distinguish clips in the editor) and set the <code>$surfaceprop</code> appropriately.
<syntaxhighlight lang=php>
LightmappedGeneric
{
$translucent 1
$basetexture "tools/toolsclip"
%compileclip 1
$surfaceprop wood
%keywords    clip
}
</syntaxhighlight>


==See also==
==See also==

Revision as of 00:51, 5 November 2025

English (en)中文 (zh)Translate (Translate)

For a list of clip textures, see Tool textures (Source)#Clips.

Clip textures are invisible tool textures that limit movement, typically of the player(s). A brush used with a clip texture is generally termed a clip brush. However, any unrendered brush or model can fill this role.

The practice of constraining the player

A fence surrounded by both a playerclip and blocklos brush

There are good techniques and there are bad techniques when it comes to using clip brushes to limit the player's movement.

Good techniques are the ones that keep the player away from possibly getting entangled and stuck in complicated brushwork such as in between a tree and a hill, or amidst the cracks of several rocks, forcing the player to restart. However, wedge-shaped clip brushes can also be used to prevent the player from getting stuck on small detail brushes like window sills or buttons while trying to run somewhere, and to prevent the player from jumping up on top of an all too narrow fence or window sill.

Bad techniques are known as invisible walls, that block the player from heading into a corridor that they are not "supposed" to enter. Apart from frustrating the player, this breaks down the illusion of an immersive world and reminds the player this is just a game. Instead, try designing visible blocks like furniture, rubble or locked doors. If this is necessary, use a visible warning to indicate to the player that this is not the correct way ahead. In Left 4 Dead 2 Left 4 Dead 2, there is a texture named wrongway_sign01 that is used in Dark Carnival to stop players from entering a small room where infected spawn.

Example

The fence on the right is enveloped by a toolsplayerclip tool texture for two reasons: First of all it prevents the player from getting caught on the brushwork when running alongside it, and second of all it prevents the player from jumping over something that would be at least cumbersome to climb over in real life. Be aware that the player could acquire physics objects and pile them up against the fence, and through this jump over the brush. If this is the case, you could consider extending this clip brush all the way to the roof of the map, but as this would create an invisible wall, it would perhaps be better to replace the entire fence with a solid wall instead.

Using clips

Available clip textures

In the Source Source engine, the general dedicated clip texture is Clip, but alternatives are Player Clip, (Player) Control Clip and NPC Clip. These all share the same Clips VisGroup category.

Texture Solid to players Solid to NPCs Solid to bots Solid for Nav Mesh Solid to C4 Counter-Strike: SourceCounter-Strike: Global Offensive Solid to hostages Usage / Notes
Toolsclip.gif
toolsclip
Yes Yes Yes Yes Yes Counter-Strike: Source Yes
Counter-Strike: Global Offensive No

It intentionally is not solid to bullets or physics, it does not cast shadows and it is transparent, for both players as well as NPCs or bots. Thus, it does not cut visleafs.

The texture is generally intended to be used on all sides of a world brush. It already gets all the aforementioned properties through its %compileclip compile flag and does not need to be tied to an entity and is not subject to optimization with func_detail. The same applies to Player clip and NPC clip, just that they are only solid to either players or NPCs respectively, and not to both.

It is the most general clip texture to use, for example to clip level bounds with vertical walls or to simplify the collisions of props, the floor or other complex geometry.

Toolsplayerclip.gif
toolsplayerclip
Yes No Yes No Yes Counter-Strike: Source Yes
Counter-Strike: Global Offensive No

Left 4 Dead seriesLeft 4 Dead series Solid to the survivors only.

Warning.pngWarning:Brushes with this texture are ignored by the nav mesh generation, which affects multiplayer games with bots. Use the red clip texture instead, especially to block out the level and to clip floors and props, otherwise the game is prone to generate areas that are unreachable, malformed or simply missing.
Toolsnpcclip.gif
toolsnpcclip
No Yes Counter-Strike: SourceCounter-Strike: Global OffensiveCounter-Strike 2Yes
Left 4 Dead seriesLeft 4 Dead seriesTeam Fortress 2No
Yes No No

Left 4 Dead seriesLeft 4 Dead series Solid to infected only, but does not stop Smokers, Boomers and Spitters from attacking through it.

Clipping physics

The entity func_clip_vphysics is used to clip only physics objects like dropped weapons etc. Create a clip or nodraw brush and tie it to an entity of the aforementioned class. This means that if both players and physics should be clipped, you need two brushes inside each other, for example a clip world brush and a copy of it tied to a func_clip_vphysics entity.

Invisible Displacement

Alternative invisible displacement, for when clip brushes are too difficult to create.

In some cases, clip brushes are not an option, or too difficult to make an accurate clip brush around props.
For example, Left 4 Dead often used displacement brushes using invisible textures to make something like a clip, which covers rubble props.

Env_Player_Blocker

Another useful, but very limited alternative are env player blocker entities. These are rectangular point entities that block players in it's volume. This entity is mostly used in "Cleanup" activities via the Commentary System or LMP file edits after a map has been compiled already.

Clips with Surfaceprop

One issue with the generic red clip texture is that it inherits the default $surfaceprop which plays concrete footsteps when walked on. This is why some games, like Counter-Strike: Global Offensive and Garry's Mod, have multiple red clip tool textures that use specific material surface properties, such as concrete, dirt, glass, etc. This allows the clips to sound different when stepping upon and also make use of the surface properties, like the very low friction of "SlipperySlide". Example uses of this is utilizing glass clips when working on glass catwalks, which would allow you to still hear glass noises when stepping onto the clip, whereas the generic clip texture would otherwise play a default concrete sound which would be out of place.

For games that do not have these clip textures, you could create your own or copy them from a game that has them. But that may not work in some games, as it will cause every single clip to use the surfaceprop of whichever clip your first interacted with. Left 4 Dead 2 for example causes this sound bug to occur.

Alternatively, you can (with more overhead) use the following workaround to avoid creating new material files: Build your brushwork for the clip using any texture that possesses the material properties you require. For example, glass/glasswindow007a, simply because it is glass. Turn the brushwork into a func_brush that is set to "Don't Render", "Always Solid", and "Solid BSP". This stops your brush from cutting Vis Leaves and becomes invisible, just like a clip brush would. However, depending on thickness, it will also block bullets and also physical props and projectile weapons, such as grenades, or arrows, because it is merely invisible brushwork.

You can also create your own material. For example, to get a wooden clip material, create a new text file 🖿<game>/materials/tools/toolsclip_wood.vmt, reuse the clip texture (or create your own to be able to distinguish clips in the editor) and set the $surfaceprop appropriately.

LightmappedGeneric
{
	$translucent 1
	$basetexture "tools/toolsclip"
	%compileclip 1
	$surfaceprop wood
	%keywords    clip
}

See also