nyuuzyou/wikis huggingface dataset:
$parallax

It enables Parallax mapping on the surface of the PBR material.
==Parallax Mapping==
Parallax mapping is a shading technique used to give perceived depth to brushes with this applied. In order to have this work correctly, you will need to have a Heightmap embedded in the alpha channel of your Normal map. This can be done with a program like , and a tutorial on how to do this can be found here
==Parameters==
==See also==
*$mraotexture
*Physically Based Rendering
*Category:PBR
Category:PBR
$parallaxmap

It specifies the VTF texture to use for the 'sub-vertex modeling' or parallaxmap of the material surface. The texture used for this parameter is a Heightmap.
=== VMT Syntax ===
 "$parallaxmap" <texture path>
 "$parallaxmapscale" <float> // Scales the $parallaxmap Y value by this amount
== See also ==
* Parallax mapping
p
$phong

It is also available on the and shaders in all games since . It provides s at low intensity and s at apex intensity, masked by a texture which control per-texel its intensity. For a full explanation, see Phong materials.
==Syntax==
 $phong <bool>
:
VertexLitGeneric
{
	$phong 1
	$bumpmap				[texture]
	$phongexponent			5			// either/or
	$phongexponenttexture	[texture]	// either/or
	$phongboost				1.0
	$phongfresnelranges		"[0 0.5 1]"
}
== Parameters ==
=== Masking ===
* Using $selfillumfresnel without will mask the using the 's alpha channel.
* Using $selfillumfresnel with will multiply the by 0.0f. Effectively disabling the effect!
* When not using $selfillumfresnel. The mask used for will be the 's alpha channel unless is also used.
* If is used, the 's alpha channel will be used for Phong masking. Using either $basemapalphaphongmask or $basemapluminancephongmask will override it.
=== Brightness ===
=== Colors ===
===Brush Shader Parameters ===
:
== Console Commands ==
== See also ==
* Phong materials
* (environment map)
* 
* 
== External links ==
* $Phong on brushes*: The Hacky Way - A TF2maps.net guide on how to fake $Phong on brushes for games prior to CS:GO. Can also be used to fake phong on static props which are lit per-vertex, without falling back to lower-quality point lighting on the main prop
*SubstancePainter Source Engine Complex Phong Shader
pCategory:VMT Lighting
Category:Material System
$pointsamplemagfilter

$pointsamplemagfilter is a material shader parameter available in , , and for LightmappedGeneric. It disables texture filtering on a material if the texture resolution is bigger than the space it occupies onscreen, and linearly interpolated (smooth) if its smaller, and will use mipmaps.
This makes it pixelated when near the texture, but smooth when far way, and will not produce moiré patterns when viewed at grazing angles or from distance, unlike just enabling Point Sampling flag in a material's VTF.
== VMT syntax example ==
 $pointsamplemagfilter <bool>
pointsamplemagfilter
$poseparameter

It allows configuration of a blend sequence, by specifying the range of values ahead of time.
== Syntax ==
 $poseparameter <$sequence name> <int min> <int max> [loop <int>] [wrap]
 $poseparameter yaw -90 90 loop 360
 $poseparameter vehicle_wheel_fl_spin -180 180 360
; loop <int>
: Defines a custom value to wrap at? 
; wrap
: Values less than min wrap around to max, and so on.
== See also ==
* $sequence
* Blend sequence
poseparameter__NOTOC__
$prepend

Allows you to add more options to the specified sequences or animations after declared, by expanding it, except the options are processed before currently set options for the specified animation. This somehow also allow expand macros
== Syntax ==
 $prepend "SequenceName" <options>
== Examples ==
$sequence "idle" a_idle {
	loop fps 40
	iklock "rfoot" 1 0
	iklock "lfoot" 1 0
}
// more QC stuff \\
// add this options before all other $sequence "idle" options
$prepend "idle" {
	activity ACT_IDLE 1
}
== See also ==
* $append Add more options to the specified sequences or animations after all other options.
* $continue Add more options to the specified sequences or animations. Replaces both $prepend and $append QC commands.
* $definemacro
* $definevariable
Category:Source
prepend
Category:Modeling
$pushd and $popd

These commands 'push' and 'pop' directories to and from the QC's active folder, instead of writing out the foldernames in the smd file.
This can be useful in situations where you moved all models into a different folder while you're knee deep in a project and don't want to adjust all $model and $sequence lines to change the folder names.
Multiple $Pushd can be nested inside each other, so long as there are a corresponding number of $popd.
== Syntax ==
 $pushd <path>
 ...
 $popd
== Example ==
In The following examples, we got a "Project" folder containing the QC file and a "Models" folder. The "Models" folder has a "Anims" subfolder.
===Not Nested===
$pushd "models"					//Enter "models" folder
	$model Cam1 "camera_body.smd"
	$model Cam2 "camera_arms.smd"
$popd							//Undoing previous $Pushd. Essentially leaving "models" folder
$pushd "models/anims"			//Enter "models/anims" folder
	$sequence	idle "idle.smd"
$popd							//Undoing previous $Pushd.
===Nested===
$pushd "models"						//Enter "models" folder
	$model Cam1 "camera_body.smd"
	$model Cam2 "camera_arms.smd"
	
	$pushd "anims"					//Previous $Pushd made us enter "models" folder. Now from here, we enter "anims"
		$sequence	idle "idle.smd"
	$popd							//Undoing previous $Pushd. But now we're back in "models". So we need one more $Popd.
$popd							 //You can either write two $Popd on one line, or use $Pushd "../../" to jump out two folders in one command
===Advanced Nesting===
In this example, we have a "Project" folder which contains the folders "QCs", "Models" and "Anims".
The QC is in the "QCs" folder, which we first need to leave using $Pushd "../", followed by the folder we want to jump into.
$pushd "../models"					//Leave QCs folder and immediately enter "models" folder.
	$model Cam1 "camera_body.smd"
	$model Cam2 "camera_arms.smd"
	$pushd "../anims"				// Instead of using $Popd followed by $Pushd, we jump straight into the anims folder from here.
		$sequence	idle "idle.smd"
$popd								//Undoing previous $Pushd. Since we undid the $pushd "../models" by using $pushd "../anims", we got a single directory we pushed into. Therefore needing a single $popd
But at some point its way easier to just define folders in the smd string instead of keeping track of your $Pushd and $Popd.
Defining the model files like this, without $Pushd and $Popd requires less space and achieves the same effect.
$model 		Cam1 "../models/camera_body.smd"
$model 		Cam2 "../models/camera_arms.smd"
$sequence	idle "../anims/idle.smd"
pushd
$qcassert

$qcassert is a QC command which will stop a model from compiling if a condition is not what it is expected to be. 
== Syntax == 
 $qcassert <condition> <arguments> <bool>
If the result of the condition is not equal to the boolean specified, the compile will fail, informing the user of the result of the assert.
Currently, there are only 2 conditions.
* boneexists (takes bone name and model source name)
* importboneexists (takes bone name)
== Example ==
 $qcassert boneexists "whatifgaming" "official.dmx" false
If there is a bone in the DMX file "official.dmx" named whatifgaming, compiling will cease. Otherwise, the model will compile as normal.
== See also ==
*QC command
$realignbones

It forces all the bones to reorient themselves – if possible - so that their longest axis is along their X axis. This helps with building both hitboxes, quite often child bones are at some diagonal to their parent and the axis-align-bounding-box that gets connected to their parent bone is often badly shaped for models that are mostly made of long tubes, as well as making IK possible since the IK system requires that the child bones are always along the X axis of their parent. 
Bones with multiple children, such as the pelvis, are not realigned and cannot be used as part of an IK system (i.e. the hip bone can't change position in relation to the pelvis). 
== Syntax ==
 $realignbones
realignbones__NOTOC__
$reflectivity

$reflectivity overrides a VTF file's embedded reflectivity value. It tells VRAD how much light should be bounced off the material, without affecting how much it receives.
== Usage ==
To bounce 50% of received light:
$reflectivity "[.5 .5 .5]"
The value is a material vector, representing a RGB color value.
== External links ==
* YouTube Video - Source Engine $reflectivity Shader Parameter
* Nodraw.net - brief explanation with screenshots of effects
r
$renamematerial

It allows a model to use a different material to the one specified in its reference SMD.
Renamed materials remain independent from each other for identification purposes, even if they share a new material name. As a result, this command cannot be used to lower the original material count.
== Syntax ==
 $renamematerial	<current material>	<new material>
== Usage with $texturegroups ==
Renamed materials must be stated with their original material names when listed in a $texturegroup, see below:
$body "model_1.smd" //Mesh using material "material_1"
$body "model_2.smd" //Mesh using material "material_2"
//Rename "material_2" on "model_2" to match the material name on "model_1"
$renamematerial "material_2" "material_1"
$texturegroup skinfamilies
{
	{ "material_1" }
	{ "material_3" }
}
The above example would result in only the faces from "model_1" being changed to "material_3" because the compiler still identifies the faces on "model_2" as being assigned to "material_2" even though it was renamed to match.
In order for the materials to change correctly, you must list the original material name in the first texture group and state the rename command after.
$texturegroup skinfamilies
{
	{ "material_1" "material_2 }
	{ "material_3" "material_3" }
}
$renamematerial "material_2" "material_1"
== See also ==
*$cdmaterials
*$texturegroup "skinfamilies"
*$lod "replacematerial"
renamematerial
$rimlight

It adds a constant rim light to the model that appears to come indirectly from the environment. The color of the rim light is directly influenced by ambient light and behave closer to $phongfresnelranges Z component.
: 
: 
==VMT syntax==
 $rimlight <bool>
 VertexLitGeneric
 {
 	$phong			1
 
 	$bumpmap		<texture>
 	$phongexponent		5		
 	$phongexponenttexture	<texture>	
 	$phongboost		1.0
 	$phongfresnelranges	"[0 0.5 1]"
 
 	$rimlight 1
 	$rimlightexponent 2
 	$rimlightboost .2			
 }
== Additional Parameters ==
== See also ==
* 
* Phong materials
* Phong Fresnel ranges
rimlight
Category:VMT Lighting
$root

It resets what bone is used as the "root" bone if there are multiple root - no parent - bones. The root bone is used for all movement and rotation calculations, as well as setting the root bone for ragdolls. This command is usually used to remove controller bones from the animation process.
== Syntax ==
 $root <bone name>
== Example ==
 $modelname "npcs/dog.mdl"
 $cdmaterials "models/npcs/"
 $model Dog "dog"
 $root "pelvis"
 $sequence idle "idle"
root
$scale

It uniformly multiplies the size of all subsequent model files. It does not affect values defined in the QC itself (e.g., locations).
Sequences or animations can be scaled individually by specifying the "scale" option, see below for an example.
:
== Example ==
=== $scale ===
$modelname		"weapons/shell.mdl"
$cdmaterials	"models/weapons/"
$scale		3		// before any model files such as SMD or DMX)
$body		shell	"shell_ref.smd"
$sequence	idle	"shell_idle.smd"
=== $sequence scale ===
$sequence spin fan_spin.smd {
 fps 30
 scale 3
}
== Values for International System of Units ==
Values for scaling meshes if the model was based on SI. Unscaled models may have incorrect dimensions.
1 foot = 16 units	1 foot = 16 units	1 foot = 16 units	1 foot = 16 units	1 foot = 16 units	1 foot = 16 units	1 foot = 16 units	1 foot = 16 units
Millimeters 	 	 	 	 	 	 	
Centimeters 	 	 	 	 	 	 	
Meters 	 	 	 	 	 	 	
Kilometers 	 	 	 	 	 	 	
1 foot = 12 units	1 foot = 12 units	1 foot = 12 units	1 foot = 12 units	1 foot = 12 units	1 foot = 12 units	1 foot = 12 units	1 foot = 12 units
Millimeters 	 	 	 	 	 	 	
Centimeters 	 	 	 	 	 	 	
Meters 	 	 	 	 	 	 	
Kilometers 	 	 	 	 	 	 	
== See also ==
Dimensions
__NOTOC__
scale
$seamless scale

It was created to sidestep texture stretching issues on displacement surfaces. Models can use this effect on detail textures only with $seamless_detail.
== Basic Syntax ==
 $seamless_scale <float>
 LightMappedGeneric
 {
 	$basetexture Example\Example01
 	$surfaceprop concrete
 	$seamless_scale 0.005
 }
 VertexlitGeneric
 {
 	$basetexture Example\Example01
 	$surfaceprop concrete
 	$detail "models\props_forest\cliff_detail"
 	$detailscale 4
 	$detailblendfactor 1
 	$detailblendmode 0
 	$seamless_detail 1
 	$seamless_scale 0.005
 }
==Additional Parameters==
== Caveats ==
* This is not a total solution—there are still some situations where stretching will occur (such as sudden 90° outcroppings). It's handled as best it can be, though.
* You can no longer scale the material with the Hammer Face Edit Dialog. The parameter's value must instead changed in the material itself.
* Hammer's 3D view renders the material itself correctly, but others will stop working.
* Standard normal mapping is supported in , but in other games only its self-shadowing cousin.
* 
* textures are unsupported. 
== History ==
According to 's developer commentary, this feature was added in response to difficulties experienced with the creation of the antlion caves section. The complicated topography of the areas exaggerated a previously bearable material-stretching effect.
This effect is a result of how Source usually handles displacements: a UV map is locked to the vertices of a displacement surface, and when a vertex on it is translated the polygons linking it to its neighbours stretch or contract accordingly, carrying the texture with them. This can lead to polygons with squashed textures sitting beside others with stretched and blurred ones; an unpleasant effect.
$seamless_scale separates the material's coordinate system from the vertices of the displacement, allowing it to maintain a regular scale across an entire surface without any designer effort.
== Matching Texture Scale ==
Assuming a texture size of 1024x1024, setting $seamless_scale to 0.0078125 will match the 0.25 scale in hammer. This was achieved by dividing (1 / (texture size * desired scale)).
For example, if texture size was 1024x1024:
* 0.125 = (1 / (1024 * 0.125)) = 1 / 128 = 0.0078125
* 0.25 = (1 / (1024 * 0.25)) = 1 / 256 = 0.00390625
* 0.50 = (1 /(1024 * 0.5)) = 1 / 512 = 0.001953125
* 0.75 = (1 / (1024 * 0.75)) = 1 / 768 = 0.0013020833333333
* 1.00 = (1 / (1024 * 1.0)) = 1 / 1024 = 0.0009765625
* 1.25 = (1 / (1024 * 1.25)) = 1 / 1280 = 0.00078125
Additionally, it appears textures are inverted on the Y axis.
seamless scale
$sectionframes

It causes all the animations that are longer than <min frame count> to be cut into <frame count> sections, stored in separate data blocks. This helps with cache access, especially when used with .ani files.
This defaults to $sectionframes 30 120 if unspecified in the QC file.
== Syntax ==
 $sectionframes <frame count> <min frame count>
== See also ==
* $animblocksize
* $bonesaveframe
__NOTOC__
sectionframes
$skiptransition

This adds a rule to the transition graph to allow direct movement between all the named nodes. This is useful for transitions between unique named nodes that that may not require any specific intermediate animation. This is how to avoid the transition graph from forcing "walk" to "run" to instead be a "walk" to "stand" to "run" transition.
== Syntax ==
 $skiptransition <name1> <name2> [<name3> ...]
__NOTOC__
skiptransition
$specmap texture

This shader is used for surfaces to give PBR style shiny speculars. Works with and . This shader works only with deferred rendering lighting entities which are using SpecularMultiplier parameter (in the game code or as the property), the entities are: , , (flashlight), , , , , , , , , (flashlight).
This shader is mainly used for , because this is the only option to have gloss effect on world geometry and bmodel. For mainly used , because new lights are also support this shader; this shader works with baked lights and have a lot of parameters. 
== Parameters and Effects ==
== See also ==
* - moss shader.
* - parallax occlusion mapping shader.
* - 4 way blend shader.
* - gbuffer's halflambert option.
* - directional sun light with godrays only.
* - spawner of deferred point lights.
* - cinematic dynamic lens flare.
* - spot deferred light entity.
* - entity that changes deferred light settings.
* - entity that changes godrays settings.
* - deferred cascade sun light entity.
* New Lights Editor - in game deferred lights editor.
* Effect flags - effects flags, some of them are dynamic light effects.
* BlackMesa XenEngine: Part 4 – Lighting & Shadows - page from Chetan (lead programmer for Black Mesa) about new lights.
* BlackMesa XenEngine: Part2 – How a Frame is Rendered - page from Chetan (lead programmer for Black Mesa) about how a frame is rendered.
* BlackMesa XenEngine: Part1 – Heavily Modified Source Engine page from Chetan (lead programmer for Black Mesa) about .
$ssbump

It is a boolean parameter that flags a texture as being a self-shadowing bump map. 
Standard bump maps only darken texels that are facing away from a light source. Self-shadowing bump maps darken both texels facing away and also any texels which are 'behind' them, similar to Ambient Occlusion maps in modern game engines. You can read more about the technology behind it in this paper. 
==Example==
== $ssbumpmathfix ==
The parameter addresses an issue with SSBump Textures being too bright.
It can be found in the VMT's of , , , and 
However the Parameter itself does not appear to be functional in some of them.
The Parameter addresses an issue where SSBump's unlike their Normal Map counter parts are non-unit Vectors.
More specifically, unlike the .x and .y components of the Bump Basis, the .z components don't cancel out.
The maximum range of the result, is equal to the sum of the .z components. 3* (1.0f / sqrt(3.0f)) or 1.73205f 
This causes SSBumps to be MUCH too bright.
Luckily, this can retroactively be accounted for by multiplying the result with Desired_Range / Current_Range or numerically1.0f / 1.73205f 
==Limitations==
The shadows cast by the bump map are permanently baked into the texture, meaning that they can only appear in one of three predefined locations. height2ssbump generates shadows for light arriving from the right, top-left, and bottom-left of the texture. If light arrives from between those directions (such as from the left), the nearest available baked shadows are blended between, producing an acceptable but hardly ideal image.
Additionally, in order to preserve the illusion of height, low areas of a SSBumped material will receive less light even if it arrives head-on. This can look odd if you have too intense (rugged) a SSBump.
== Creation ==
You need to use height2ssbump, a command line SDK tool. The command is:
The output is <input name>-ssbump.tga, in the same folder as the input file. Bumpscale controls the intensity of the ssbump (i.e., coarseness of the surface). 
You can use normal2ssbump, another SDK tool, to generate an SSBump from a normal bump map (as opposed to a height or displacement map) - Unlike height2ssbump you do not need to run through the command line or use any additional parameters; simply drag-and-drop your normal map onto the program or a shortcut. 
=== Options ===
;<path/filename>
:The source heightmap (TGA format).
;-r <int>
:Set the number of 'rays' (default 250). More rays take more time.
;-n
:Generate a conventional bump map as <input name>-bump.tga.
;-d
:Generate an ssbump detail texture, used with 10 and 11.
:
;-A
:Generate ambient occlusion in the alpha channel.
;-f <int>
:Set smoothing filter radius (default 10; 0 disables).
;-D
:Write out filtered result as filtered.tga.
An example of a complete command is:
=== Third Party Tools ===
Third-party tools capable of generating SSbump maps:
*Substance Designer Utility Node
*Filter Forge 2.0
*Xnormal (In Tools, select 'Height map to normal map', then tick 'Radiosity NM')
*SSbump Generator
ssbump
Category:VMT Lighting
$staticprop

It tells the model compiler that this model is not intended to have any moving parts. This will cause the compiler to strip away the skeleton & animations to just a single, unmoving bone named static_prop.
Static props are the only models allowed to cast shadows onto the lightmap and vice-versa during VRAD.
A model flagged with $staticprop is not necessarily limited to just being used with the prop_static point entity. Neither prop_physics nor prop_static will function unless the model was compiled with this command.
==Example==
 $modelname props_junk/metal_paintcan001a.mdl
 $staticprop
 $body body metal_paintcan001a_lod0
 [...]
==See also==
* prop_static
* prop_physics
Category:Modeling
staticprop
Category:Source
$subd

The QC command $subd is used to mark a model to be tessellated in run-time. This can be used to make models appear smoother than they actually are.
It also is needed to make $displacementmap work.
== Syntax ==
 $subd
== Example ==
 $modelname		"example/subdivision.mdl"
 $cdmaterials		"example/subdivision"
 $subd
 $body		test	"subdivison.dmx"
 $sequence	idle	"subdivision_idle.smd"
s
$surfaceprop

It is also available as a shader parameter. It links the surface of either a material or model to a set of physical properties, including:
* What sounds are emitted during collisions
* What effects are emitted when the surface is shot
* Mass, buoyancy, bounciness...
* The effect of the surface on nearby sounds (reverberation, echo, absorption...)
== Syntax ==
Syntax is the same for both models and materials:
 $surfaceprop <name>
Names are defined in <game>\scripts\surfaceproperties_manifest.txt (and the files it references). For a list of Valve's stock props, see Material surface properties.
== In Materials ==
* $surfaceprop is not linked to any particular shader, so it can be used at any time.
* Only brush based shaders require this parameter. $surfaceprop must always be defined within the collision property of the QC file if anything other than the default is to be used, however.
== In Models ==
* It is unclear whether a model's mass is calculated from $surfaceprop or prop_data.
* Surface props can be defined for individual bones with $jointsurfaceprop.
* A static prop can only have one $surfaceprop.
== See also ==
* Material surface properties
* List of CS:GO Surface Types
surfaceprop
surfaceprop
$texture2

* Used for the UnlitTwoTexture shader.
* Compare to $basetexture2
==VMT syntax==
 "UnlitTwoTexture"
 {
 "$basetexture" "Path/TextureA" 
 "$texture2" "Path/TextureB" 
 "$texture2transform" "center .5 .5 scale 1 1 rotate 0 translate 0 0"
 "$texture2scale" 1.0
 }
== Additional Parameters==
===$texture2transform===
 $texture2transform <>
* Dx9 only?
===$texture2scale===
 $texture2scale <>
*
$treesway

In , it can also be used for .
$treesway morphs the vertices of a mesh with a given material around using the parameters of an entity to give the appearance of tree leaves and foilage blowing in the wind. The subparameters of $treesway determine how much the env_wind entity should affect the morphing, and all of them (except $treeswaystatic) must be specified in order for the effect to work properly. This shader parameter assumes any model using it is facing upwards.
==Parameters==
== External links ==
https://gamebanana.com/tuts/12924 - How to achieve a similar effect without $treeSway, on all source engine games. Alternatively, use an animated , for a more realistic (but more expensive) effect.
t
$unlockdefinebones

Normally, the $definebone definitions are always used for the default positions and rotations of the skeleton. Setting $unlockdefinebones will instead use the bone positions of the first frame in the last defined smd/dmx file of the qc for the definebone values.
$Unlockdefinebones will not shuffle the order of the $definebone lines, unlike the studiomdl command -definebones would.
== Syntax ==
 $unlockdefinebones
unlockdefinebones
__NOTOC__