docs.unity3d.com
    Show / Hide Table of Contents

    Class Smoothing

    Provides utilities for working with smoothing groups. ProBuilder uses smoothing groups to define hard and soft edges. To calculate vertex normals, ProBuilder performs these tasks:

    1. Calculates the normals for every face.
    2. Applies the results of those calculations to each vertex on the face.
    3. Averages each vertex normal with coincident vertices belonging to the same smoothing group.
    Inheritance
    Object
    Smoothing
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.ProBuilder
    Syntax
    public static class Smoothing

    Methods

    ApplySmoothingGroups(ProBuilderMesh, IEnumerable<Face>, Single)

    Generates smoothing groups for a set of faces by comparing adjacent faces with normal differences less than angleThreshold (in degrees).

    Declaration
    public static void ApplySmoothingGroups(ProBuilderMesh mesh, IEnumerable<Face> faces, float angleThreshold)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The mesh to apply new smoothing groups to.

    IEnumerable<Face> faces

    Faces to inspect for smoothing.

    Single angleThreshold

    Set the maximum value to consider the shared edge smooth. This value is an angle in degrees that represents the difference between adjacent face normals.

    GetUnusedSmoothingGroup(ProBuilderMesh)

    Returns the first available unused smoothing group.

    Declaration
    public static int GetUnusedSmoothingGroup(ProBuilderMesh mesh)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The target mesh.

    Returns
    Type Description
    Int32

    An unused smoothing group.

    IsSmooth(Int32)

    Tests whether the specified smoothing group is smooth.

    Declaration
    public static bool IsSmooth(int index)
    Parameters
    Type Name Description
    Int32 index

    The ID of the smoothing group to test.

    Returns
    Type Description
    Boolean

    True if the smoothing group value is smoothed; false otherwise.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023