Web-Friendly 3D Models [Fast]
Web-Friendly 3D Models [Fast]
Welcome back. We've generated some models, and now we need to optimize them before using them in the game. There are two ways: a quick and easy method, and a more advanced approach using Blender. The Blender method gives more control, but the fast way is usually enough for simpler games. Let's start with the quick method.
We're using fal.ai again. I created two models—one with Trellis and one with Rodin. We'll use the Trellis model first. Log into fal.ai, click "Requests," find your model, and click the play button. If the model doesn't appear due to a bug, click the three dots, select "Open in Playground," and it should appear. Now, download your model.
I created a folder called "Spaceship Two" because this is our second spaceship. We'll optimize the first spaceship with Blender later. Rename this downloaded file "spaceship_two." Currently, it’s about 1.5 MB, which gives us plenty of room for optimization.
Next, go to gltfeditor.com (all links are in the AI Builder's Hub under "3D Model Optimization"). Drag your model onto the canvas. With your model selected, go to "Tools," then "Optimize Textures," and select "Resize." Change texture size from 1024 to 512 pixels and click run. This will significantly reduce the file size.
You can perform additional optimizations like merging materials or removing duplicate geometry, but be cautious because it can sometimes break your model. If it happens, reload the model and try again. The main improvement is resizing the texture.
After optimization, click "File," then "Save." Choose WebP for textures at around 75% quality and select GLB as your file format. Draco geometry compression can reduce size even more, but often causes issues in this editor, so test carefully. Disable animations if your model doesn't have any. Download your optimized file, rename it clearly (like spaceship_two_opt_512), and check it using gltf.report.
If Draco compression causes problems, export again without it. In the side-by-side comparison, the optimized model is significantly smaller and uses much less memory. Optimizing your models is essential for better game performance.
You can also compress GLB files further using the website "Optimize GLB," or use the GLT Transform library from GitHub if you prefer local optimization.
That's it for the quick optimization method. If you need further clarification, refer back to the AI Builder's Hub guide. Now, let's move on to the next lesson and optimize our second spaceship model using Blender. See you there.