Skip to content

Export Nodes SourceIORefractVMTNode

REDxEYE edited this page Nov 20, 2026 · 1 revision

VMT Refract

Builds a Refract material (VMT): base texture, normal and DuDv maps, refraction amount, blur and tint.

VMT Refract node

Inputs

Input VMT parameter Group Purpose
Base texture $basetexture Textures Diffuse/albedo colour. Alpha is used by $translucent, $alphatest and, unless a mask is linked, by $selfillum.
Normal texture $normalmap Normal Normal map used to distort the refracted background.
DuDv texture $dudvmap Normal DuDv (distortion-offset) map used to offset the refracted background.

All inputs are VTF sockets (single link each, not multi-input) and are optional: an unconnected input simply omits its VMT parameter. Each one accepts the output of a VTF Output node. You can also drag a Texture socket straight onto one of these inputs; SourceIO then inserts a VTF Output node for you, named <vmt path without .vmt>_<suffix>.vtf (albedo for $basetexture, otherwise the parameter name without $) with Normal map (linear) enabled for $bumpmap/$normalmap. Any other link type is removed. At export, a linked input that does not resolve to a VTF recipe raises " must resolve to a VTF Output recipe".

Outputs

Output Type Description
Material Material The rendered VMT text plus every VTF it references. Connect it to the Materials multi-input of a Source 1 model output (many materials allowed), or to its Skin families input (SourceIO then inserts a Skin family node that lists this VMT's name).

Properties

Header controls (all VMT nodes)

Control Meaning
Blender material (mat) The Blender Material this VMT replaces. Required: the node raises "VMT requires a Blender Material binding" without it. Mesh slots that use this Blender Material are exported under this VMT's file name; a mesh slot whose Blender Material has no linked VMT node stops the export with "No linked VMT bound to ... slot".
VMT path under materials (vmt_path) Output path of the .vmt, relative to the game's materials/ folder (default models/props/material.vmt). A leading materials/ and the .vmt extension are normalised; absolute paths, .., : and quotes are rejected. The file stem becomes the material name in the QC, and the folder is added to $cdmaterials automatically.
Sync VMT to disk (button) Writes only this node's .vmt to the game root of every Source 1 model output the node feeds, without encoding textures (VTF paths are still referenced). Errors if the node is not connected to a model output.

Each group below is a collapsible box in the node. Textures, Surface / Alpha, Normal and Shader-specific start expanded, the rest start collapsed. Collapsing a group also hides that group's unlinked texture inputs, so open the group to see and connect them; linked inputs always stay visible.

Textures

This group only lists the link state of the texture inputs; it has no value controls for this shader.

Surface / Alpha

Control Meaning
$model Written as "$model" "1" when enabled (default on). Required for materials used on models.
$translucent Written as 1 when enabled. Alpha-blended transparency from the base texture alpha, so the base VTF needs an alpha-capable format (DXT5, RGBA8888, ...).
$alphatest Written as 1 when enabled; pixels are cut out by alpha.
$alphatestreference Only shown while $alphatest is on (0-1, default 0.5). Alpha cut-off, written as $alphatestreference.
$nocull Written as 1 when enabled: draw both faces of every polygon.
$selfillum Written as 1 when enabled: the surface glows independent of lighting. Uses the Self-illumination mask if linked, otherwise the base alpha (engine behaviour).
$color2 RGB tint (0-1). Written as $color2 [r g b] only when it differs from white.

Normal

Shows the link state of the normal-related texture inputs; it has no value controls.

UV transforms

One toggle per texture slot; when a toggle is on, scale, rotation and translation appear and the transform is written as center .5 .5 scale <sx> <sy> rotate <rotation> translate <tx> <ty> (the rotation value is written unchanged; VMT rotation is in degrees). Defaults: scale (1, 1), rotation 0, translation (0, 0).

Toggle Applies to
$basetexturetransform Base texture

Shader-specific

Control Meaning
$refractamount Strength of the refraction distortion (default 0). Written only when not 0.
$bluramount Blur of the refracted image (default 0, minimum 0). Written only when not 0.
$refracttint RGB tint of the refracted background (default white). Written as $refracttint [r g b] only when it differs from white.

Raw / Proxies

Control Meaning
Ordered raw VMT KV entries (raw_parameters) A Blender Text datablock whose content is KeyValues entries copied into the shader block verbatim and in order (duplicates and nested blocks are kept). Use it for any VMT parameter the node has no control for, e.g. "$surfaceprop" "metal". Parse errors abort the export; an entry that repeats a generated parameter (including a texture key of a linked input) is rejected as a conflict.
Proxy KV entries (proxy_parameters) A Blender Text datablock holding entries for the Proxies block. Each entry must itself be a named KeyValues block (for example AnimatedTexture { ... }), otherwise the export fails with "Each Proxies entry must be a named KeyValues block".

How it works

When a Source 1 model output builds the graph, this node produces one VMT: a "<shader>" block holding, in order, the texture parameters of linked inputs, then $model, $translucent, $alphatest, $nocull, $selfillum, $phong (those that are enabled), $alphatestreference, phong values, $envmap, $color2, the other typed parameters (detail, tint, UV transforms, shader-specific values), your raw entries and finally a Proxies block. The shader name is written in lower case. Parameters equal to their default are skipped so the file stays minimal. Every linked VTF is encoded by its VTF Output node and written to materials/<vtf path>.vtf next to the VMT under the model output's game root; two textures that map to the same path with different bytes, or two materials with the same VMT path and different text, abort the export.

Shader behaviour. Refract samples the already-rendered scene behind the surface and distorts it by a normal map (or a DuDv map), with optional blur and tint; it is used for glass, water-like and lens surfaces. The normal map goes to $normalmap (not $bumpmap) and the DuDv map to $dudvmap.

Texture and colour-space behaviour. No colour conversion by this node. A texture linked to Normal texture by drag gets a VTF Output with Normal map (linear) enabled; the DuDv texture link is a plain data texture (auto-inserted VTF Output does not set the normal flag).

Example workflow

  1. Connect the surface tint/base image to Base texture.
  2. Connect a normal map to Normal texture (optionally through Normal Map Ops) and/or a DuDv map to DuDv texture.
  3. In Shader-specific raise $refractamount, add $bluramount or a $refracttint if needed. Open UV transforms to scale the base texture.
  4. Pick the Blender material, set the VMT path, connect Material to the model output and export.

Caveats

  • $refractamount defaults to 0 and is then omitted: the shader needs a non-zero amount to visibly refract.
  • Only the base texture has a UV transform here.
  • This shader has no Phong or Environment groups; use Raw / Proxies for anything else.
  • Refraction is a screen-space effect that depends on the target engine branch; whether a surface also needs $translucent or $nocull is your decision in Surface / Alpha.

Export Nodes

Clone this wiki locally