This article's documentation is for anything that uses the Source engine. Click here for more information.

$cliptotextures: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{tabsBar|main=gs|base=$cliptotextures}}
{{tabsBar|main=gs|base=$cliptotextures}}
The [[QC command]] '''$cliptotextures''' instructs the compiler to clamp all vertex texture co-ordinates to the range '''[0 1]'''. This will distort the texture projection for any triangles whose vertices contain values outside this range, so is usually not required unless you have a specific reason to use it.
{{This is a|name=$cliptotextures|QC command}} It instructs the compiler to clamp all vertex texture co-ordinates to the range '''[0 1]'''. This will distort the texture projection for any triangles whose vertices contain values outside this range, so is usually not required unless you have a specific reason to use it.


If [[$cliptotextures]] is not specified, the compiler will leave the texture co-ordinates at their original values (or optimised equivalents). Under normal circumstances, texture co-ordinates outside the '''[0 1]''' range will simply wrap around the texture image, meaning they will look identical to co-ordinates within the '''[0 1]''' range.
If [[$cliptotextures]] is not specified, the compiler will leave the texture co-ordinates at their original values (or optimised equivalents). Under normal circumstances, texture co-ordinates outside the '''[0 1]''' range will simply wrap around the texture image, meaning they will look identical to co-ordinates within the '''[0 1]''' range.

Revision as of 21:19, 16 July 2025

$cliptotextures is a QC command available in all Source Source games. It instructs the compiler to clamp all vertex texture co-ordinates to the range [0 1]. This will distort the texture projection for any triangles whose vertices contain values outside this range, so is usually not required unless you have a specific reason to use it.

If $cliptotextures is not specified, the compiler will leave the texture co-ordinates at their original values (or optimised equivalents). Under normal circumstances, texture co-ordinates outside the [0 1] range will simply wrap around the texture image, meaning they will look identical to co-ordinates within the [0 1] range.

3D artists occasionally make use of this wrapping behaviour in the UV mapping step of creating a model. If multiple sections of a model need to make use of the same area of the underlying texture, placing vertices over each other at the same co-ordinates can be more difficult to work with in the modeling software. Placing vertices at higher or lower multiples of these co-ordinates can allow the artist to visually separate the vertices in the modeling software, and have these vertices map back to the same area of the texture when the model is compiled. In this case, $cliptotextures would not be used when compiling the model, as the out-of-range texture co-ordinates would be clamped to values that the artist did not intend.

Syntax

$cliptotextures ;

See also

Empty

This article or section is empty. You can help by adding it.

External links