Class Smoothing | ProBuilder | 4.3.1
docs.unity3d.com
    Show / Hide Table of Contents

    Class Smoothing

    Utilities for working with smoothing groups. Smoothing groups are how ProBuilder defines hard and soft edges. ProBuilder calculates vertex normals by first calculating the normal for every face, which in turn is applied to each vertex that makes up the face. Afterwards, each vertex normal is averaged with coincident vertices belonging to the same smoothing group.

    Inheritance
    Object
    Smoothing
    Namespace: UnityEngine.ProBuilder
    Syntax
    public static class Smoothing

    Methods

    ApplySmoothingGroups(ProBuilderMesh, IEnumerable<Face>, Single)

    Generate 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 source mesh.

    IEnumerable<Face> faces

    Faces to be considered for smoothing.

    Single angleThreshold

    The maximum angle difference in degrees between adjacent face normals for the shared edge to be considered smooth.

    GetUnusedSmoothingGroup(ProBuilderMesh)

    Get 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)

    Is the smooth group value considered smooth?

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

    The smoothing group to test.

    Returns
    Type Description
    Boolean

    True if the smoothing group value is smoothed, false if not.

    Back to top
    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