Difference between revisions of "$subd"

From Valve Developer Community
Jump to: navigation, search
m ("Triangles" > "Polygons" in the mat_tessellationlevel tip, even though "triangles" is probably more correct.)
m (clarification on placement of $subd line)
Line 14: Line 14:
Note that $subd must be placed ''before'' your model line.
== Example ==
== Example ==

Revision as of 16:41, 18 September 2017

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.

Tip:The smoothness can be adjusted using the console variable mat_tessellationlevel <1-16>, with higher values rendering more polygons.
Confirm:Only works with Source Filmmaker?

Warning: 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.



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


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