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 16: Line 16:
==External links==
==External links==
* '''clip_texcoords''' in the [https://github.com/fnky/studiomdl/blob/master/src/studiomdl.c#L1266 portable studiomdl sources], whose value is set by the presence of [[$cliptotextures]].
* '''clip_texcoords''' in the [https://github.com/fnky/studiomdl/blob/master/src/studiomdl.c#L1266 portable studiomdl sources], whose value is set by the presence of [[$cliptotextures]].
[[Category:QC Commands|cliptotextures]]

Latest revision as of 21:28, 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