In this tutorial we will have a look at a certain type of input data using tiled textures and therefore tiling- optimized UV atlases to make the most out of performance and visual quality. This type of input data is very common in the 3d production for fashion and furniture items coming from an offline rendering workflow as well as architectural rendering and 3d buildings, where we have alot of repeated structures and details, in general.
We will be able to optimize the model, eg. by reducing polycount, while still preserving the same tiling UVs and tiled textures as in the input as well as in addition also bake a seperate atlas based occlusion map. Let us start with downloading the source model here.
We will use the following pool of settings to handle input data with tiled textures:
Name | Type | Default | Valid Range | Quick Description |
---|---|---|---|---|
decimation:preserveTiledUVs | Flag | false | {true, false} | preserves repeating texture coordinates during decimation |
decimation:tiledUVThreshold | Real | 1.5 | {1 .. inf} | UV extent after which a UV channel is considered repeating (= tiling texture) |
decimation:preserveMaterialBorders | Flag | false | {true, false} | preserves mesh material borders during decimation |
Let us first have a look at the input model:
Now we can see what is normally happening with the asset if we compact it with default settings:
rpdx -i armchair.glb -c f:20% -e compact/armchair-compact.gltf
As you can imagine this result might not be optimal in many cases because of the clever set-up and usage of tiled textures in the original. To preserve the tiling just write a config with the command
rpdx --write_configand change the following setting in the config file to true:
Name | Type | Default | Valid Range | Quick Description |
---|---|---|---|---|
decimation:preserveTiledUVs | Flag | false | {true, false} | preserves repeating texture coordinates during decimation |
Now we can proceed by simply entering the same command again using our new config:
rpdx -i armchair.glb -c f:20% -e compact-tiling/armchair-compact.gltf
In case you want to preserve the Tiling and bake an additional map, which does not work via tiling and thus needs to have an atlas, you can use the following settings in conjunction, setting all of them to true:
Name | Type | Default | Valid Range | Quick Description |
---|---|---|---|---|
ao:enabled | Flag | false | {true, false} | turns AO (Ambient Occlusion) generation on/off |
Name | Type | Default | Valid Range | Quick Description |
---|---|---|---|---|
decimation:preserveTiledUVs | Flag | false | {true, false} | preserves repeating texture coordinates during decimation |
Now simply continue by using the following command:
rpdx -i armchair.glb -c f:20% -e compact-tiling-ao/armchair-compact.gltf