$subd: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (clarification on placement of $subd line)
($displacementmap note)
Line 4: Line 4:


The [[QC command]] '''<code>$subd</code>''' 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.
The [[QC command]] '''<code>$subd</code>''' 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.


{{tip|The smoothness can be adjusted using the [[ConVar|console variable]] <code>mat_tessellationlevel <1-16></code>, with higher values rendering more polygons.}}
{{tip|The smoothness can be adjusted using the [[ConVar|console variable]] <code>mat_tessellationlevel <1-16></code>, with higher values rendering more polygons.}}


{{confirm|Only works with [[Source Filmmaker]]?}}
{{confirm|Works in games other than [[Alien Swarm]] and [[Source Filmmaker]]?}}


{{warning|[[Studiomdl]] will crash if any triangles are present in the model. '''<code>$subd</code>''' only works with quads and ''n''-gons with more than 3 edges. This effectively makes the [[Studiomdl Data|SMD]] format unusable, meaning you have to use the [[DMX]] format, as SMD only supports triangles. The SMD format can still be used for animations, though.}}
{{warning|[[Studiomdl]] will crash if any triangles are present in the model. '''<code>$subd</code>''' only works with quads and ''n''-gons with more than 3 edges. This effectively makes the [[Studiomdl Data|SMD]] format unusable, meaning you have to use the [[DMX]] format, as SMD only supports triangles. The SMD format can still be used for animations, though.}}

Revision as of 09:47, 7 May 2018

An example of a low-poly sphere.
Same model, utilizing $subd and mat_tessellationlevel 16.
Click the image to expand it.

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.

Tip.pngTip:The smoothness can be adjusted using the console variable mat_tessellationlevel <1-16>, with higher values rendering more polygons.
Confirm:Works in games other than Alien Swarm and Source Filmmaker?
Warning.pngWarning:Studiomdl will crash if any triangles are present in the model. $subd only works with quads and n-gons with more than 3 edges. This effectively makes the SMD format unusable, meaning you have to use the DMX format, as SMD only supports triangles. The SMD format can still be used for animations, though.

Syntax

$subd

Note that $subd must be placed before your model line.

Example

$modelname		"example/subdivision.mdl"
$cdmaterials		"example/subdivision"
$subd
$body		test	"subdivison.dmx"
$sequence	idle	"subdivision_idle.smd"