相关文章推荐
奔放的排球  ·  Design a RealBrowser ...·  9 月前    · 
豪爽的枕头  ·  WebSocket API ...·  10 月前    · 

Vertex normals are invisible lines pointing out of a 3D model's surface, at each vertex. The game compares these normals against a light's direction. If the light is directly facing a normal, the surface is brightest there. When a normal is facing away from a light, the surface doesn't get lit by it.

Game artists can manually alter the vertex normals to change the way an in-game mesh is lit, how it renders a reflection, how the fresnel falloff looks, etc. Any lighting effect that uses vertex normals can be tweaked by changing the model's vertex normals.

Some game engines do not import edited vertex normals. Check your engine's documentation, or try a quick test.

Contents

  • 1 What Is a Vertex Normal?
  • 2 Model Seams
  • 3 Smoother Shading
  • 4 Normal Mapping
  • 5 Editing Normals
  • 5.1 3ds Max
  • 5.2 3ds Max Tools
  • 5.2.1 Vertex Normal Toolkit
  • 5.2.2 Normal Tools (WallWorm)
  • 5.2.3 Face Weighted Normals MAXScript
  • 5.2.4 Noors Normal Thief MAXScript
  • 5.2.5 Weighted Vertex Normals
  • 5.2.6 Vertex Normals Stitcher
  • 5.2.7 Slide Normal Thief MAXScript
  • 5.2.8 GetVertNormalsFromFaces MAXScript
  • 5.2.9 AverageNormal MAXScript
  • 5.2.10 Normal Thief MAXScript
  • 5.3 Cinema 4D
  • 5.4 Maya
  • 5.4.1 Transfer Attributes
  • 5.4.2 FaceNRMtoVert
  • 5.4.3 froTools Orient Constraint Normals
  • 5.4.4 mig Normal Tools
  • 5.5 Modo
  • 6 More Information
  • What Is a Vertex Normal?

    FrostSoft: WHAT ARE VERTEX NORMALS (VNT documentation)

    Image by FrostSoft .

    Model Seams

    Game models are often cut apart into different segments, for example to allow a player to customize their character by swapping out different clothing models.

    When a contiguous mesh is cut apart, the vertex normals along the edge usually change. Vertex normals are usually calculated automatically by the modeling software, to average out the local surface curvature. However this causes a shading seam along the cut, because the two models now have different vertex normals along their shared edge.

    To help hide this artifact, the seams between the pieces are usually cut along natural seams, like the belt line, shoulders, neck, wrists. This doesn't hide all of the seams though.

    Bent vertex normals can be used to hide these seams completely, by manually averaging the two models' edges together.

    Smoother Shading

    See Face weighted normals .

    Bending normals on bevelled models.
    From the tutorial Shading techniques Superspecular soft edges
    Image by Paolo Oliverio

    Normal Mapping

    Vertex normals have a strong influence on tangent-space Normal maps . Some game engines require a bit more geometry near areas that have a lot of change in angle (hard corners, etc.) otherwise the vertex normals fight with the normal map and create shading errors. Careful Topology can minimize or avoid these errors altogether.

    Editing Normals

    3ds Max

    Vertex normals can be manually bent in 3ds Max by using the Edit Normals modifier. See the 3ds Max 2011 online help .

    Vertex normals can also be modified by using Smoothing Groups , as long as the normals have not been edited by the Edit Normals modifier beforehand. See the Smoothing Groups Tutorial by Ben "poopinmymouth" Mathis .

    Edited vertex normals are somewhat fragile in 3ds Max, they can be lost easily:

  • If you use Editable Poly, activate Attach, and attach another model, the vertex normals will be kept. However Editable Mesh - Attach will reset the normals.
  • If you Attach multiple meshes together, make sure each has at least one edited normal. Meshes without edited normals will have their vertex normals jumbled.
  • If you Attach models that have been rotated, make sure to use Reset Xforms on them first. Attaching a rotated model to another will skew all its edited normals.
  • If you use Detach to make a new Object, the detached object's vertex normals will be reset.
  • If you use Detach to create a new Element in the same object, the detached element's vertex normals will be reset.
  • If you add an Edit Normals modifier and make the normals Explicit, then go below it in the modifier stack and Detach as an Element, the normals will be preserved. This works with Editable Mesh, Edit Mesh, Editable Poly, and Edit Poly.

    3ds Max Tools

    These are in order by date, older tools towards the bottom.

    Vertex Normal Toolkit

    Vertex Normal Toolkit ($) by scgstudio

    Normal Tools (WallWorm)

    Normal Tools by Shawn Olson is a set of tools integrated into the existing Edit Normals modifier as a new rollout. Normal Tools for Max Released Polycount Forum thread.

    Face Weighted Normals MAXScript

    Face Weighted Normals by Juan 'monster' Martinez is a 3ds Max MAXScript tool that selectively aligns the vertex normals for the largest polygons on a mesh. This means the smaller polygons act as the transition areas because usually the smaller polygons are thin bevels.

    See the Polycount Forum thread Skew you buddy! Making sense of skewed normal map details.

    Noors Normal Thief MAXScript

    NoorsNormalThief by "Noors" is a 3ds Max MAXScript tool that projects vertex normals from one model to another, automating what would otherwise be a tedious manual process. See the Polycount Forum thread I've made a faster NormalThief .

    The script is based on NormalThief written by Mauricio B. Gehling , and on SlideNormalThief by Slide London .

    Weighted Vertex Normals

    Weighted Vertex Normals MAXScript by Martijn Buijs .

    This MaxScript generates Weighted Vertex Normals for any arbitrary geometry.

    'Weighting' of vertex normals means that each face normal contribution is scaled by a property of the triangle. This script uses the triangle surface area and corner angle as influences. The result of this is that a small triangle will have less influence on shading of its larger neighbor. Likewise, the neighbor will have larger influence on the shading of the smaller neighbor.

    This effect is typically most visible on chamfered boxes, but enhances all types of geometry. All geometry with proper weighted vertex normals is mathematically guaranteed to produce more aesthetically appealing shading than the default 3dsmax generated vertex normals.

    Vertex Normals Stitcher | ScriptSpot

    This script averages vertex normals at the borders (Open Edges). It allows you to smooth surfaces after separating their vertices/edges/faces. For example after detaching faces or splitting edges. It still keeps hard edges if the object has multiple smoothing groups.

    Slide Normal Thief MAXScript

    SlideNormalThief by Slide London was a 3ds Max MAXScript tool that projects vertex normals from one model to another, automating what would otherwise be a tedious manual process.

    SlideNormalThief is unfortunately no longer available on their website. However, NoorsNormalThief is available, and runs faster too!

    SlideNormalThief was based on a slower script called NormalThief.ms written by Mauricio B. Gehling .

    The Reference Object is the model you wish to copy vertex normals from, and the Target Object is the model that will get its normals bent to match. The two models should be superimposed on one another, the normals on the Target will be bent to match the nearest normals on the Reference. This is similar to the way NormalMap projection works, the copying is based off location in 3D space. The vertex counts of the two models don't need to match, but both models need to have an Edit Normals modifier applied.

    GetVertNormalsFromFaces MAXScript

    File:GetVertNormalsFromFace 0 2.ms.zip by Enrico 'SyncViewS' Gullotti is a 3ds Max MAXScript tool that aligns all the vertex normals for the selected faces so they point perpendicular to their polygons. In other words, the same direction as the face normal would be facing. This is similar to the mig Normal Tools option "Fillet Outside".

    Once installed the script will be under the category Normal Tools , named Get Vert Normals from Faces . It works on Editable Poly objects only, and that must be the active modifier in the modifier stack. If an Edit Normals Modifier is not present, the script will add one right above Editable Poly. It should not mess with Smoothing Groups at all.

    Go into Face sub-object level, make a face selection and run the script. Every time a normal is modified by the script, it is made Explicit to retain the modifications. At the end the script will switch back to the base Editable Poly modifier and re-enter Face sub-object level (even if other modifiers are present in the stack). If you want to revert back to the original default normals, add an Edit Normals Modifier and reset the normals.

    See the Polycount Forum thread Editing vertex normals in Max, got scripts? .

    AverageNormal MAXScript

    File:AverageNormal.mcr.zip by Mathieu 'zOffTy' Jacquin is a 3ds Max MAXScript tool that averages all the vertex normals for the selected coplanar faces, so they their normals all point in the same direction.

    Normal Thief MAXScript

    NormalThief.ms by Mauricio B. Gehling is a 3ds Max MAXScript tool that projects vertex normals from one model to another, automating what would otherwise be a tedious manual process.

    Faster versions of this script have since been made, see VertexNormal#Slide_Normal_Thief_MAXScript and VertexNormal#Noors_Normal_Thief_MAXScript .

    Cinema 4D

  • FrostSoft: VERTEX NORMAL TOOL PLUGIN allows the editing of vertex normals in Cinema 4D.
    Vertex Normal Tool plugin for Cinema 4D. Image by FrostSoft .

  • Add Normals plugin explicitly creates the Normals Tag for each vertex, allowing the export (but not editing) of explicit normals.
  • Cinema 4d tips and tricks thread from the Polycount Forums.
  • CINEMA 4D Import Conversion System by Okino Computer Graphics has in-depth information about vertex normal support in Cinema 4D

    Vertex normals can be adjusted in Maya by using the Normals tools in the Polygons menu (Maya 2011 online help).

    Transfer Attributes

    Vertex normals can also be baked from one model to another by using Transfer Attributes .

    FaceNRMtoVert

    "passerby" wrote a melscript that does a similar function as the GetVertNormalsFromFace maxscript.

    #!highlight csharp
    global proc FaceNRMtoVert() {
        string $Fs[] = `filterExpand -sm 34`;
        select -cl;
        for ($F in $Fs) {
            select -r $F;
            string $normals[] = `polyInfo -faceNormals`;
            string $buffer[];
            tokenize $normals[0] $buffer;
            float $plane[3];
            $plane[0] = $buffer[2];
            $plane[1] = $buffer[3];
            $plane[2] = $buffer[4];  
            PolySelectConvert 3;
            polyNormalPerVertex -xyz $plane[0] $plane[1] $plane[2];
    For more info see the Polycount forum thread GetVertNormalsFromFace script for maya.
    

    froTools Orient Constraint Normals

  • froTools 3.2 : new enhanced UI and tools Baking normals in modo, using the pipelineIO plugin.
    Image by Ariel Chai.

    More Information

  • Foliage
  • Foliage Vertex Color
  • Normal map
  • Smoothing Groups
  • Vertex color
  •