March 19, 2025
3 min read

Optimize AI generated 3D Models for the Web

Written by [object Object]

By Kevin Kern

In this blog post, I’ll walk you through step-by-step how to optimize your GLTF model in Blender, so your game runs faster, smoother, and without unnecessary lag. Let’s get started!

1. Getting Started

Check the File Size of your model

Import Model

Blender Shading Modes

Switch between different shading modes (It takes some time to load - wait 1minute if the textures are not loading)

2. Optimize Model

Merge by Distance

This tool removes duplicate or unnecessary vertices that are very close to each other, optimizing your model for better performance.

How to use it:

  1. Enter Edit Mode (Tab).

  2. Select all vertices (A).

  3. Press M → Choose Merge by Distance.

  4. In the bottom-left operator panel, you can adjust the Distance Threshold (keep it small, like 0.0001 to 0.001).

Why do it?

  • Removes excess geometry from model imports.

  • Cleans up artifacts from decimation.

  • Reduces file size without affecting the shape.

Optimize Textures

The model has a texture applied which we can inspect and check its size.

After Saving the file check its size. And you can see that the texture has 1.4MB

Compress the image

  1. Go to tinypng.com and upload your texture.

  2. Now compress it and download it again

You have now 2 files. Call the new texture file _opt.png so its clear which one is the compressed image.

Now lets replace the new texture with the old one

Choose the optimized image we’re done

Optional: UV Edit

If the texture looks incorrect:

  1. Go to the UV Editing tab.

  2. Select the model and check if the UV map aligns with the new texture.

  3. Adjust if needed.

Reduce Polygon Count

  • Select your model → Go to Modifier Properties → Add Decimate modifier.

  • Adjust the Ratio (start around 0.5 or lower).

  • Click Apply when satisfied.

Now lower the polygon count without significantly losing shape detail. (Around 0.2 - 0.5)

Important: If you’re finished you need to Apply!!! the changes (CMD + A) or click apply.

Fix Normals (Optional)

You can skip this step. It help if you discover some issues with the model.

Check Normals (Fix Inside-Out Faces)

Normals define which direction each face is pointing. If they're flipped, your model may render incorrectly (e.g., dark spots or missing faces).

How to fix normals:

  1. In Edit Mode, select all (A).

  2. Press Shift + N to Recalculate Normals.

  3. If some faces still appear wrong:

    • Go to Overlays (top-right) → Enable Face Orientation.

    • Blue = correct, Red = flipped.

    • Manually flip bad faces: Select a face → Press Alt + NFlip.

Why do it?

  • Prevents rendering issues in Blender and game engines.

  • Ensures proper lighting and shading.

  • Fixes broken shading after decimation or import.

3. Export

Now lets export our model file as “.glb” file

Testing & Validation

Validate with gltf.report

Optimize further using glTF Transform

Access it here

Access the Viber3D modern starter kit for 3D browser games here.

Want to learn more?

Sign up to Instructa Pro

Access the full video course on building 3D Games with AI that run directly in your browser, as well as:

  • Unlimited access to all course modules

  • Get access to all course updates

  • Unlimited Access to Guides & Prompts

  • Access to the private Discord community

Click here: Instructa Pro

Other interesting posts:

Have a look at the rest of my blogs posts:

Happy coding!🚀