Smoothing groups: Difference between revisions
SirYodaJedi (talk | contribs) (aka "phong") |
SirYodaJedi (talk | contribs) No edit summary |
||
(21 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{stub}} | {{stub}} | ||
[[ | [[File:Smoothing groups smoothing example.jpg|thumb|400px|right|The cylinder on the left is not smoothed.<br> The cylinder in the middle is smoothed with the default [[Lightmap#Scale|lightmap scale]] of 16.<br> The cylinder on the right is smoothed with a [[Lightmap#Scale|lightmap scale]] of 8.]] | ||
'''Vertex Smoothing''' simply uses [[Vertex normal]]s ([[vector]]s) as if they were [http://en.wikipedia.org/wiki/Surface_normal Surface normals] to generate a kind of ''pseudo-''[http://en.wikipedia.org/wiki/Subdivision_surface subdivision surface] for the Lighting shader to work with. This is | '''Vertex Smoothing''' simply uses [[Vertex normal]]s ([[vector]]s) as if they were [http://en.wikipedia.org/wiki/Surface_normal Surface normals] to generate a kind of ''pseudo-''[http://en.wikipedia.org/wiki/Subdivision_surface subdivision surface] for the Lighting shader to work with. This is also known as {{w|phong shading}}, not to be confused [[phong materials|phong reflections]]. | ||
When a number of adjacent surfaces are assigned to the same | 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| | |||
* On lightmapped surfaces, smooth shading will be more effective on higher-resolution lightmaps; see right. | |||
* Edges sometimes must have contiguous texture [[UV]]s for smooth shading to have a noticeable effect, particularly on vertex-lit geometry. | |||
}} | |||
{{bug|hidetested=1|In {{src13|4}} and possibly other engine branches, [[smoothing groups]] are not properly written for [[func_detail|detail brush]] faces. This is fixed in the {{slammin|2}}, {{mapbase|2}}, and {{gmod|2}} versions of VBSP, and code for this fix can be found in [https://github.com/ValveSoftware/source-sdk-2013/pull/391 pull request 391 on GitHub]. | |||
{{workaround|If stock compilers must be used, increasing the auto-smoothing threshold to 47 ({{code|-smooth 47}}) can help. Alternatively, use [[func_brush]].}}}} | |||
{{modernImportant|Hammer's smoothing groups only affect [[brush]]es, not [[displacement]]s! 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 with a slight offset instead of sewing.}} | |||
==Guidelines== | ==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]]. | * 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]]; how this is handled depends upon the specific editor. | ||
==Auto Smoothing== | ==Auto Smoothing== | ||
VRAD will automatically smooth angles (between faces without smoothing groups) which are ≤45° (or technically ≥135°). In at least some versions of VBSP, this can be altered with the {{code|-smooth}} parameter (default 45.); higher values will smooth sharper corners, and 0 will effectively disable auto-smoothing. | |||
{{confirm|When was parameter this added? {{src13}} and {{csgobranch}} have this, but {{src07}} does not.}} | |||
[[File:AutoSmoothing.png|thumb|600px|left|Brushes of 45 degrees or less will be auto smoothed.]]{{clr}} | [[File:AutoSmoothing.png|thumb|600px|left|Brushes of 45 degrees or less will be auto smoothed.]]{{clr}} | ||
==See | ==See also== | ||
* [[Hammer_Smoothing_Groups_Dialog|Smoothing Groups in Hammer]] | * [[Hammer_Smoothing_Groups_Dialog|Smoothing Groups in Hammer]] | ||
* [[Model_Creation_Overview#Editing_Hard.2FSoft_Edges|Smoothing Groups in XSI]] | * [[Model_Creation_Overview#Editing_Hard.2FSoft_Edges|Smoothing Groups in XSI]] | ||
[[Category:Modeling]][[Category:Level Design]] | [[Category:Modeling]][[Category:Level Design]] |
Latest revision as of 20:17, 29 June 2025

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

- On lightmapped surfaces, smooth shading will be more effective on higher-resolution lightmaps; see right.
- Edges sometimes must have contiguous texture UVs for smooth shading to have a noticeable effect, particularly on vertex-lit geometry.







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; how this is handled depends upon the specific editor.
Auto Smoothing
VRAD will automatically smooth angles (between faces without smoothing groups) which are ≤45° (or technically ≥135°). In at least some versions of VBSP, this can be altered with the -smooth parameter (default 45.); higher values will smooth sharper corners, and 0 will effectively disable auto-smoothing.