This guide is for Baker CLI 0.10.7 and older versions
Baker Cli has all the same functions you can find on Baker Gui (which is in development), using only the console.
Basics
- Download Baker Cli
- Once you download Baker Cli, you will be asked to log in using your credentials. After logging in successfully, the console window will close.
- You can see all possible parameters you can use with Baker by typing the command - -help in the console.
- You can start using Baker Cli.
Example
Here’s an example of how Baker works so you can get a better understanding of it. I will also include the files you need here so you can start trying Baker with this example.
I will be using Trunk 01 from our library, offline meshes 2 and 4 and the albedo map. These can be downloaded from the Asset Library.
-
To work with Baker, we need to create a .bat file first (which is an executable file that runs a command for us after we write it). You can create a text file with your preferred text editor and change the extension to .bat. After that, you can open the file and add the parameters, I will bake an albedo map for the LOD4 from the LOD2, so the .bat file will contain the parameters necessary to do so.
-
After writing the parameters, please make sure to put all of them in only one line, each one separated by spaces. After doing that, you can add the pause command in the following line, this way the program will stop after completing the albedo map baking.
-
Once the file is ready, you can save it and execute it. To do so, just click on the file and it will start the baking process.
-
That’s it! You now have an albedo map baked in 17 seconds. This is the result:
Files:
- .bat file (make sure to change the paths according to the routes in your PC)
bake_normal.bat (347 Bytes)
In detail
After logging in, the console window will close. In order to open it again and see the parameters you can use with Baker, follow these steps:
- Open the console and go to the folder where Baker Cli is located, you can do it by typing cd Path/to/BakerCliFolder. If Baker is located on a drive different than C:/ you will need to write the drive name first, for example, if Baker is located on the drive D:/, type D:
- Once you’re at the Baker Cli folder, write bakercli - -help and you will see all the parameters you can use with Baker.
Let’s take a look at each parameter:
- -low_model = “path/to/lowpolymesh.obj”
This parameter will contain the path to your low poly mesh. Currently, Baker only supports .obj, so please make sure your model is an .obj file
- -high_model = “path/to/highpolymesh.obj > path/to/highpolymesh/texture.tif”
This parameter will contain the path to your high poly mesh and the path to the texture map that belongs to it.
- -output_width = integer
This parameter will contain the output width of the texture. You will only need to write the number of your desired resolution width. You can also call this parameter by typing -x
- -output_width = integer
This parameter will contain the output height of the texture. You only need to write the number of your desired resolution. You can also call this parameter by typing -y
- -output_map = “map_type > depth > channels number > path/to/save/outputmap.tif”
This parameter will contain the output map that you want to generate, the depth, number of channels, and the file path for the output map, you can add this parameter multiple times.
Map types:
color // Any map that’s intended to be transferred goes here
ao
height
normal
world_normal
Bit-depth types:
uint8 //8-bit
uint16 //16-bit
float32 //32-bit
Channel count:
1 // Grayscale
3 // RGB
4 // RGBA
- -read_low_def_normals
If this parameter is added. low definition normals will be read.
- -read_high_def_normals
If this parameter is added. low definition normals will be read.
- -expansion_coefficient (decimal)
This parameter represents the amount of shifting/inflation of the low-definition mesh so all faces are outside of the high-definition mesh
- -inward_tracing
If this parameter is added, rays will be casted only inward (to the opposite direction of the low definition mesh)
- -ao_samples (integer)
This parameter represents the number of ao samples to be rendered when creating the AO map.
- -denoise_ao
If this parameter is added, the ambient occlusion map will be denoised.
- -compact_mode
if this parameter is added, memory usage will be reduced drastically. All meshes are optimized so more polygons fit in memory. When used, baking is slower.