docs.unity3d.com
Search Results for

    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.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.ProBuilder
    Assembly: Unity.ProBuilder.dll
    Syntax
    public static class Smoothing

    Methods

    ApplySmoothingGroups(ProBuilderMesh, IEnumerable<Face>, float)

    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.

    float 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
    int

    An unused smoothing group.

    IsSmooth(int)

    Tests whether the specified smoothing group is smooth.

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

    The ID of the smoothing group to test.

    Returns
    Type Description
    bool

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

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)