Smoothing groups

From Valve Developer Community
(Redirected from Smoothing)
Jump to: navigation, search

Stub

This article or section is a stub. You can help by adding to it.

The cylinder on the left is not smoothed.
The cylinder in the middle is smoothed with the default lightmap scale of 16.
The cylinder on the right is smoothed with a lightmap scale of 8.

Vertex Smoothing simply uses Vertex normals (vectors) as if they were Surface normals to generate a kind of pseudo-subdivision surface for the Lighting shader to work with. This is also known as Wikipedia icon phong shading, not to be confused phong reflections.

When a number of adjacent surfaces are assigned to the same Smoothing group, the Rendering Engine will "soften" the light and shadow across each vertex or edge shared by the group. This makes the geometry seem smoother when viewed from most angles. It does not soften the profile or silhouette of the object.

Tip.pngTip:On lightmapped surfaces, smooth shading will be more effective on higher-resolution lightmaps; see right.
Tip.pngTip:Edges sometimes must have contiguous texture UVs for smooth shading to have a noticeable effect, particularly on vertex-lit geometry.
Icon-Bug.pngBug:In Source 2013 Source 2013 and possibly other engine branches, smoothing groups are not properly written for detail brush faces. This is fixed in the Slammin' Source Map Tools Slammin' Source Map Tools, Mapbase Mapbase, and Garry's Mod Garry's Mod versions of VBSP, and code for this fix can be found in pull request 391 on GitHub.
PlacementTip.pngWorkaround:If stock compilers must be used, increasing the auto-smoothing threshold to 47 (-smooth 47) can help. Alternatively, use func_brush.
  [todo tested in?]
Icon-Important.pngImportant:Hammer's smoothing groups only affect brushes, not displacements! Displacements which are sewn together are always shaded smooth; this can be worked around by having the vertices of the base brush faces not be aligned, manually aligning the displacement vertices together instead of sewing.

Guidelines

  • Brush geometry must be manually assigned to a Smoothing Group in Hammer. Model geometry smoothing data is configured in the model editor before SMD export.

Auto Smoothing

  • In at least some games, VRAD will auto smooth angles (between faces without smoothing groups) which are less than or equal to the -smooth parameter (default 45).
Confirm:When was this added? Source 2013 and CS:GO engine branch have this, but Source 2007 does not.
Brushes of 45 degrees or less will be auto smoothed.

See also