Nodes/ComfyUI libigl/Compute Normals
ComfyUI Node

Compute Normals

Give a bare mesh its normals back so it renders like it's supposed to

By PozzettiAndrea·Created 10 months ago·Updated 4 days ago· 218
Compute Normals
  • trimesh
  • mesh_with_normals
smooth_vertex_normalstrue

Somewhere between "I generated a mesh" and "I want to look at it," the normals fall off. Plenty of mesh generators, exports, and frankenstein workflows hand you a mesh with geometry but no normal data - and without normals, lighting has nothing to work with, so the viewer shows you a flat, dark, or faceted mess. Compute Normals is the fix: it derives normals for the mesh and hands you a version that actually shades properly.

The mechanics are the boring kind of useful. Every triangle has a geometric normal you can compute from its three vertices; this node does that, and optionally smooths the result across the surface so neighboring triangles shade like a continuous surface instead of a polygon. The one input that matters is smooth_vertex_normals (a COMBO, default true): leave it on for organic shapes that should look smooth, turn it off when you want flat, hard-edged shading - think low-poly or mechanical parts where you want every facet visible.

The inputs and output

  • trimesh - the mesh in (TRIMESH type, from GeometryPack's loaders or any downstream node).
  • smooth_vertex_normals - the true/false COMBO described above.
  • mesh_with_normals - the only output, and it's worth noting this node is not an output node: it's a pass-through that hands a mesh with computed normals to the next step. It's a stage in a pipeline, not a destination.

Wire it between a mesh source and a viewer, an exporter (many OBJ/glTF pipelines want authored normals), or a downstream GeometryPack node that expects sane shading. Combine it with Check Normals and Fix Normals and you've got the full "make this mesh render correctly" loop: check orientation, fix flips, compute smooth normals, done.

Installing it

Standard GeometryPack install:

cd ComfyUI/custom_nodes
git clone https://github.com/PozzettiAndrea/ComfyUI-GeometryPack.git
cd ComfyUI-GeometryPack
pip install -r requirements.txt --upgrade
python install.py

Restart ComfyUI. ComfyUI Manager can handle it too - search "GeometryPack" or install via Git URL with https://github.com/PozzettiAndrea/ComfyUI-GeometryPack.git. The pack's one-click installer is experimental and brings in pixi via comfy-env; the README's manual route is the reliable one, and the author openly welcomes issue reports since the pack is a fast-moving WIP.

Where people get confused

Normal computation doesn't fix wrong normals, it overwrites them. If a mesh has genuinely flipped faces (inconsistent winding), Compute Normals will happily compute nice normals for the flipped ones - pointing inward. The smooth shading will look fine and the geometry will still be broken. That's why the repair flow is Check Normals → Fix Normals → Compute Normals, in that order. Also, if the mesh is non-manifold, the computed normals can be ambiguous around the bad edges; that's a geometry problem, not a normals problem, so clean the topology first.

Categorygeompack/repair

Inputs (2)

NameTypeDefaultDescription
trimeshTRIMESH
smooth_vertex_normalsCOMBOtrue2 options: true, false

Outputs (1)

NameTypeDescription
mesh_with_normalsTRIMESH