Tutorial: Remesher in Blender
This tutorial contains these key points: |
---|
✔️ Use the Blender plugin |
✔️ Create a Settings Preset Config |
✔️ Remesh selected parts |
✔️ Decimate the remaining parts |
✔️ Export a GLB |
✔️ Compare the results |
This tutorial shows how use the RapidPipeline 3D Processor plugin in Blender to simplify a 3D model, optimizing parts with small holes using the Remesher, baking the holes into an alpha map, and decimating the rest of the model.
This tutorial makes use of the RapidPipeline 3D Processor plugin for Blender, for more information see the Blender Plugin Documentation. The plugin runs on a powerful 3D data optimization and automation toolset, for more about this see the 3D Processor Reference.
Input model (left) has been remeshed, and textures were baked including an alpha map for the holes. Source model is 48mb with 284,003 triangles, and the optimized model is 4mb with 50,000 triangles.
This tutorial uses a high-resolution plastic shopping cart model available here from TurboSquid.
Using the Remesher
- First step is to complete the installation process to make sure the RapidPipeline 3D Processor Blender plugin is installed and ready to use.
The Blender plugin for the RapidPipeline 3D Processor.
- The remeshing will be done first, so all the parts of the shopping cart named "plastic" are selected in the Blender Outliner.
Enter plastic
in the Search field, then double-click the parent icon to select them all.
- Then Shift-click on the blue plastic seat to deselect it. The child seat is a solid mesh without holes, so the decimator tends to do a better job. This part will be processed later along with the rest of the model.
Deselect the plastic seat.
- Turn on
Statistics
in the Blender viewport.
In the Viewport Overlays, enable the Statistics.
- In the top left corner of the viewport, notice that the total triangle count is 284,003.
The desired total for the optimized model is 50,000 triangles. At that resolution the model will be fairly compact but still retain significant detail from the original.
- In the Layout tab, open the Object menu, then scroll to the bottom and click on
RapidPipeline Processor
.
- In the Scene Graph Flattening tab, turn on
Enabled
, and set the Flattening Method tofull
.
This tells the Remesher to create a single mesh for all the selected parts. Without this, each mesh part would be processed on its own.
- In the Optimize tab, turn on
Enabled
. This turns on decimation and remeshing.
- Set the 3D Model Optimization Method to use
Mesh and Material Optimization
. Materials can be optimized alone, but in this case both the meshes and the materials need to be changed because the Remesher creates a whole new mesh and bakes textures from the source meshes onto the new mesh.
- Set the Mesh and Material Optimization to
Remesher
.
- In the Remesher secton set the Faces to
Faces Value
and type in25,000
.
The desired final triangle count for the entire shopping cart will be 50,000. The basket can be limited to half of that, which ensures there will be enough resolution left for other half (metal frame, wheels, strap, child seat, etc.).
Remesher Target is an upper limit. If the Remesher needs less triangles it will do this automatically, but it will never exceed this limit.
- In the Material Merger section, set the Material Regenerator to
Generate UV Atlas
.
The remesher will create a totally new mesh, and transfer the materials over from the source meshes. This setting tells 3D Processor to create UVs for this new mesh.
- Make sure the Normal Map Baking Mode is set to
always
. This will bake a bump map to preserve the bevels and details from the source model.
- Inside the section for Ambient Occlusion Map Baker, turn on
Enabled
. This will bake an ambient occlusion map for the new mesh, which also helps to preserve shading detail from the source meshes.
- Enable the Texture Baking Resolution, and set the Default Texture Map Resolution to
1024
. The original textures are 8k, but 1k for the basket and 1k for the rest should be enough detail. If this resolution isn't good enough, the Processor can simply be re-run with a higher resolution.
- The next setting Bake Topological Holes to Alpha Map is an advanced setting which is hidden by default. To expose this setting, go to the top of the UI and set the Settings Level to
Expert
. This exposes all available settings.
- Scroll down and enable the checkbox for Bake Topological Holes to Alpha Map. This will preserve the holes from the source meshes, by baking them into an alpha map for the new mesh, which is created by the Remesher.
- Scroll to the bottom, set the Remeshing Method to
shrinkwrap
, and the Resolution to5
.
The two remeshing methods Shrinkwrap and Voxelization produce different results, which can be leveraged in different situations. Shrinkwrap is generally better with mechanical shapes and hard angles, while Voxelization is better with organic meshes like clothing and characters.
The Resolution usually needs to be fine-tuned to match the size of the holes in the source topology. It decides how fine the remesh grid will be, which affects whether the new mesh will cover or poke through the existing holes. The greater the Resolution, the sharper the corners will be, but also the more likely the new mesh will start to sink into the holes.
A demonstration of Shrinkwrap resolution values for the shopping cart.
The upper resolutions for the Remesher are constrained by the Remesher Target value of 25,000 faces, which was set earlier. If higher resolutions are desired the Remesher Target can be adjusted, or it can disabled entirely. This can be useful for detailed meshes which require deep cuts.
For this model the holes are covered completely by Resolution 5. A value of 4 also works, but the edges of the basket start to distort. 5 offers enough resolution to keep corners tight, while also covering the original holes. This allows the alpha map to do the heavy lifting, and requires a lot less vertices.
- The remaining settings can be left to their defaults. Click the
Run
button to process the model.
It optimizes the meshes quickly, and when complete the original source meshes are hidden, and the new remeshed basket is shown.
Notice in the Statistics that the new basket has only 2,524 triangles, not 25,000. This is because the Remesher only needed that many to accomplish the job at Resolution 5. The Remesher Target was set to 50,000 triangles, but this is only an upper limit. This target tends to matter more when using higher Resolution values.
The Remesher Settings File
The finished settings for the Remesher can be preserved for reuse using the Save and Load buttons. Here's what that looks like:
{
"sceneGraphFlattening": {
"method": "full"
},
"optimize": {
"3dModelOptimizationMethod": {
"meshAndMaterialOptimization": {
"remesher": {
"target": {
"faces": {
"value": 25000
}
},
"materialMerger": {
"materialRegenerator": {
"uvAtlasGenerator": {
"textureBaker": {
"normalMap": {},
"aoBaker": {},
"topologicalHolesToAlpha": true
}
}
}
},
"method": "shrinkwrap",
"resolution": 5
}
}
}
},
"export": [
{
"fileName": "",
"textureMapFilePrefix": "",
"discard": {},
"format": {
"glb": {
"pbrMaterial": {}
}
}
}
]
}
Optimize the Frame
- To optimize the rest of the shopping cart, select the new basket mesh, then select Invert (Ctrl I) to select the rest of the model.
- Back in the RapidPipeline 3D Processor, go to the Optimize tab and change the Mesh and Material Optimization to
Decimator
. The rest of the shopping cart doesn't have a bunch of small holes, so traditional mesh decimation is best.
The desired overall triangle count is 50,000 triangles, and the basket was remeshed to only 2,524, so this means the rest of the shopping cart can use the remaining 47,476 triangles.
- Under the Target, set the Faces to
Faces Value
, and set the Faces Value to47,476
.
- Set the Material Optimization to
Material Merger
. This will merge all the selected parts together into a single texture set and material, using texture baking and UV atlasing.
- Make sure the Normal Map Baking Mode is set to
always
. This will bake a bump map to preserve the bevels and details from the source meshes.
- Enable the Ambient Occlusion Map Baker, to bake an occlusion map.
- Enable the Texture Baking Resolution, and set the Default Texture Map Resolution to
1024
. This was the resolution used for the basket, so it makes sense to use the same for the rest of the shopping cart.
- The remainder of the settings can stay at their defaults. Click the
Run
button to process the selected parts.
RapidPipline 3D Processor finishes optimizing the meshes quickly, and when complete the original source meshes are hidden and the decimated mesh is shown. Shift-click on the remeshed basket to show the full Statistics.
The finished result of the Remesher and the Decimator is two meshes, with a combined triangle count of 50,000.
The Decimator Settings File
The finished settings for the Decimator can be preserved for reuse using the Save and Load buttons. Here's what that looks like:
{
"sceneGraphFlattening": {
"method": "full"
},
"optimize": {
"3dModelOptimizationMethod": {
"meshAndMaterialOptimization": {
"decimator": {
"target": {
"faces": {
"value": 47476
},
"deviation": {
"percentage": 0.0
}
},
"materialOptimization": {
"materialMerger": {
"materialRegenerator": {
"uvAtlasGenerator": {
"textureBaker": {
"normalMap": {},
"aoBaker": {},
"bakingResolution": {
"default": 1024
}
}
}
}
}
},
"collapseDistanceThreshold": 0.01
}
}
}
},
"export": [
{
"fileName": "",
"textureMapFilePrefix": "",
"discard": {},
"format": {
"glb": {
"pbrMaterial": {}
}
}
}
]
}
Exporting to glTF
- Make sure the remeshed basket and the decimated frame are selected, then go to the File menu, choose Export, then glTF 2.0.
- In the Blender File View dialog make sure to open the Include dropdown and choose
Selected Objects
. This will exclude the source meshes, and export only the two new optimized meshes.
- When finished exporting, the new GLB file can be viewed in web 3D viewers like the glTF Sample Viewer. The GLB can also be uploaded to the RapidPipeline Web Platform for conversion into other formats, like USDz.
Input model (left) at 48mb with 284,003 triangles. Output model (right) is 4mb with 50,000 triangles.
Input / Output Statistics
The source model was 48mb with 284,003 triangles, 8192x8192 textures, and 20 draw calls.
The processed model is 4mb with 50,000 triangles, 1024x1024 textures, and 2 draw calls!
Input Asset | Output Asset |
---|---|
284,003 triangles | 50,000 triangles |
44 meshes | 2 meshes |
20 draw calls | 2 draw calls |
8192x8192 maps | 1024x1024 maps |
File size 48mb | File size 4mb |