---
title: "Fix flipped normals on an AI-generated 3D model"
description: "Find the faces pointing inward on a generated model, weld split vertices, recalculate normals outward and check the result with backface culling on."
canonical: https://appliedmanifold.com/mesh/fix-ai-generated-model-normals/
site: "Applied Manifold: The spatial compute cloud for 3D reality"
---

1.  [Home](https://appliedmanifold.com/)
2.  [meshfx](https://appliedmanifold.com/mesh/)
3.  Generated model normals

# How to fix flipped normals on an AI-generated model

Inward-facing triangles on a generated model show up as black patches, faces you can see through from one side and shading seams. Weld duplicate vertices so neighboring faces share edges, recalculate the normals to point outward and check the result with backface culling on. meshfx found 17,568 flipped faces on the generated wagon below, down to 0.

[Get Free API Key](https://console.appliedmanifold.com/sign-in?next=/api-keys) [meshfx docs →](https://appliedmanifold.com/docs/mesh/)

[![Generated wagon with 17,568 flipped faces on the source, marked in red as meshfx reports them, shown in three.js](/shots/meshfx/meshfx-wagon-faults-faces/three-still_800.webp)](https://appliedmanifold.com/shots/meshfx/meshfx-wagon-faults-faces/three-still.webp)

Generated wagon with 17,568 flipped faces on the source, marked in red as meshfx reports them, shown in three.js

## Why generated meshes have flipped normals

Generators extract the surface from a volume, and that step can wind some triangles the wrong way, most often in thin parts and where pieces overlap.

Engines draw only the front of each face, so an inward face disappears or renders black.

## Non-manifold edges

meshfx also finds 1,470 non-manifold edges on this wagon. Fix them too, so the recalculated normals stay consistent.

[![Generated wagon with 1,470 non-manifold edges on the source, as meshfx counts them, shown in three.js](/shots/meshfx/meshfx-wagon-faults-nonmanifold/three-still_800.webp)](https://appliedmanifold.com/shots/meshfx/meshfx-wagon-faults-nonmanifold/three-still.webp)

Generated wagon with 1,470 non-manifold edges on the source, as meshfx counts them, shown in three.js

## Fix the normals by hand

1.  Turn on backface culling or a face orientation overlay to see which faces point inward.
2.  Merge vertices by distance so neighboring faces share edges. Some generators export every triangle with its own vertices.
3.  Recalculate normals outside on the whole mesh. See [how to fix flipped normals](https://appliedmanifold.com/mesh/fix-flipped-normals/) for the command in each 3D tool.
4.  Flip any faces that still show inside out, one region at a time.
5.  Turn on smooth shading with an auto smooth angle near 30 degrees to remove faceting.
6.  Export a GLB with normals included and check it in your engine with backface culling on.

meshfx counts the flipped faces and the other faults and lists them in the report, so you know what to fix.

## In three.js, Blender and Godot

Once you fix the faces in your editor, the GLB shades the same in all three, with no black patches or missing faces.

[![meshfx wagon with levels of detail, shown in three.js](/shots/meshfx/meshfx-wagon/three-still_800.webp)](https://appliedmanifold.com/shots/meshfx/meshfx-wagon/three-still.webp)

Shown in three.js

[![meshfx wagon with levels of detail, shown in Blender](/shots/meshfx/meshfx-wagon/blender-still_800.webp)](https://appliedmanifold.com/shots/meshfx/meshfx-wagon/blender-still.webp)

Shown in Blender

[![meshfx wagon with levels of detail, shown in Godot](/shots/meshfx/meshfx-wagon/godot-still_800.webp)](https://appliedmanifold.com/shots/meshfx/meshfx-wagon/godot-still.webp)

Shown in Godot

## Use with your agent

Paste the prompt into Claude Code, Cursor or Codex. Your agent connects to Spatial Compiler and comes back with a GLB and a report that counts the holes, flipped faces and non-manifold edges, so you know what to fix.

[Get Free API Key](https://console.appliedmanifold.com/sign-in?next=/api-keys) [Try it in the Playground →](https://appliedmanifold.com/playground/?module=meshfx&cookbook=blob&spec=affe7364cbde08aadce892c88e133e47947e4f2d5a44c04617a2e3c58259a310)

New accounts start with $5 of usage, and you see the price of each job before it runs.

Agent prompt

Connect the Spatial Compiler MCP server at https://spatialcompiler.dev/mcp if it isn't connected yet. Use meshfx to count the flipped faces and other faults in my generated model so I know what to fix. Run a Draft first. Your first 50 mesh Drafts are free with the $5 signup credit. Ask before running a final compile.

Or add the server yourself in Claude Code:

`claude mcp add --transport http spatial-compiler https://spatialcompiler.dev/mcp`

[Set it up in Cursor, Codex or another agent](https://appliedmanifold.com/docs/mcp/)

## Related pages

-   [Flipped normalsRecalculate normals outside, flip the faces left over and apply mirrored scale so a model draws correctly in any engine.](https://appliedmanifold.com/mesh/fix-flipped-normals/)
-   [Mesh normalsNormals are the directions a mesh's faces and vertices point, used for lighting and culling, and flipped ones look black or vanish.](https://appliedmanifold.com/learn/normals/)
-   [Generated model scaleMeasure a generated model against one known dimension, scale it to meters, apply the scale and export a GLB your engine reads at the right size.](https://appliedmanifold.com/mesh/fix-ai-generated-model-scale/)
-   [Generated model orientationTurn a generated model upright, face it down the axis your engine expects, apply the rotation and put the origin at the center of its base.](https://appliedmanifold.com/mesh/fix-ai-generated-model-orientation/)
-   [Clean up a generated modelCheck a generated model with meshfx and make it lighter, then import the compiled file into your engine.](https://appliedmanifold.com/mesh/clean-up-ai-generated-model/)
-   [Invisible in UnityCheck flipped normals, import scale, camera clipping planes, Culling Mask and the material when a model is invisible in Unity.](https://appliedmanifold.com/mesh/model-invisible-unity/)
-   [meshfxmeshfx reads an input model, reports surface faults and compiles reduced GLB levels of detail for Godot, three.js or any glTF loader.](https://appliedmanifold.com/docs/mesh/)

[All pages in meshfx →](https://appliedmanifold.com/mesh/)

[← Generated model orientation](https://appliedmanifold.com/mesh/fix-ai-generated-model-orientation/)[Generated model to Godot →](https://appliedmanifold.com/mesh/ai-generated-model-to-godot/)

## Generated model normals questions

[All questions →](https://appliedmanifold.com/faq/)

### Why does my AI-generated model have black patches?

Some of its faces point inward. Engines draw only the front of each face, so those faces render black or disappear. Recalculate the normals outward to fix it.

### Why does recalculating normals not fix my generated model?

The faces are often split apart, so each triangle has its own vertices. Merge vertices by distance first so neighboring faces share edges, then recalculate the normals.

### Can I just make the material two-sided?

It hides the problem but doubles the pixel work on those faces and still lights them wrong. Fix the normals so the model renders correctly with backface culling on.
