The lowpoly object in modo 401
Part I: The theory - Overview
Part II: The theory - A closer look
Part III: The highpoly object in modo 401
So the highpoly mesh is done, so I import it into the low poly scene as a reference and use it as a template to model the lowpoly object. I won’t discuss the modeling part here, instead give you an overview of the scene and the baking process.
The item list
The “Meshes” group contains the referenced high definition object and the low poly one. The latter has a collision hull as a child, but that’s just an Unreal specific thing.
The cameras in the “Cameras” group are mostly there to store different render settings for different baking scenarios. This script stores all render parameters in camera items: resolution, render region settings, GI settings, etc.
Baking normal maps needs a vastly different render setup than diffuse/specular baking, so saving the settings to cameras really makes life easier.
For quick access, I extended the render menu.
The first three commands execute the CameraExtender script with different parameters. The last command sets up the camera in a way that when selected through a 3d viewport it automatically loads the render settings.
(For more on the usage of the script please visit the support thread on the modo forum.)
The “Hide no-bake polys” is a simple macro which hides all polygons in the “NoBaking” selection set. I put mirrored stuff here, which should not participate in the baking. (Their “original” stays visible.)
The next few items are used when baking. The items starting with “ObjectBake…” are the same “ObjectBakeExtender” script running in different modes:
“ObjectBake to Outputs” and “ObjectBake to Texture” does the appropriate object baking, but gets the baking distance from the low poly object. The distance can be set when clicked on the “ObjectBake Set Distance” menu item. (Usage and support thread.)
By using this script I have to set the proper distance only once and I don’t have to remember and type it in before every single baking.
So I store different render settings in those cameras. Let’s see the most important ones:
“LowPoly General Bake": Items named like this are used for baking everything but normal maps: diffuse, specular, illumination, etc.
The camera sets the following parameters:
- Render size: 2048x2048.
- Micropoly displacement: Off.
Aside of normal map baking, the only other thing displaced polygons would affect is the ambient occlusion map. Fortunately, if you recall, there was a premade AO map for the bolts and rivets, so this information is already affecting the diffuse color of the surface.
- Indirect illumination: On.
The only reason it’s not turned off is because I need to know where the object is illuminating (the light surface) or being illuminated (the metal rim around the light). I will use this information later on in the game.
“LowPoly Normal Bake": Items named like this are used for baking the tangent space normal map, which can only be done when object baking to texture.
- Render size: 2048x2048.
- Render Region: On.
It’s set to 0, 0.1, 0, 0.1, which is a small area in the top left corner, where only the background is visible. This way everything gets baked but modo needs less memory for some reason.
- Micropoly displacement: On.
As I mentioned earlier, bumpmaps on the highpoly object are discarded when baking from object to texture, so displacements have to be used.
- Shadows: Off.
- Indirect illumination: Off.
We are only interested in surface normals, so we don’t need lighting related features at all.
So the basic principle behind all this is turning off everything you don’t need for a certain rendering/baking task, then store those settings in a related camera.
Now let’s finish the item list:
After the camera group there is the “Radimeter_HP” which contains the rest of the references items from the highpoly scene, and finally there is the “Workbench” which has the same function as before.
The shader tree
At the top are the outputs for normal and general bake. The former is done into an existing image map, so the outputs don’t really matter.
This isn’t the case for the other group where all outputs matter, because they will produce all the maps I’m going to need for the in-game textures.
Then come the shaders. They both have shadows and reflections turned off, but the “Normal bake” one has “Visible to indirect rays” disabled as well.
The “Materials” section has the “Utility” group which is used the same way as in the high polygon scene. The “LowPoly” group stores the materials for both the lowpoly model and its collision hull.
At the end there are the layers from the referenced scene.
UV creation
Nothing special was going on here, just run of the mill UV work.
Here is the UV I ended up with:
While the “UV Pack” command is useful for quick UV creation, before baking the final textures, a manual pass is unavoidable.
The biggest problem with the automated method is that it doesn’t use holes in poly islands to store smaller polygons. (Like that in the bottom right corner.)
The other issue is that it handles all polys equal, so there is no way to tell it to spend more pixels on important areas. You have to do the UV weighing by hand.
Otherwise the UV creation in modo is pretty fast and straightforward.
Baking
There is not much to tell about it that I haven’t told you already. I store render settings in cameras and the baking distance in the low poly object. Then I select all items with the same prefix and chose the appropriate baking method from the render menu: “ObjectBake to Outputs” for diffuse/specular, and “ObjectBake to Texture” for the normal map. (In the latter case the normal texture in the lowpoly material must be selected first.)
Finding the best bake distance can take a few tries, but baking the diffuse map for testing is a reasonably fast process (no micropoly displacement!).
Final steps
I saved the baked outputs as a multi-layer .PSD file and generated the final textures:
The AO output is used to darken the surface and tone back specularity.
It sometimes needs tweaking based on the in-game environment: lighting conditions and real-time ambient occlusion all affect the final look of the mesh.
The export of the mesh (.ASE) and the images (.TGA) to Unreal was uneventful. I already had the base shader up and running, so it didn’t took long to see the final object in-game:
The diffuse and normal textures use 2048x2048 maps, the specular map is 1024x1024 (also used to controls the reflection amount), the emissive texture is 512x512 while the lightmap’s resolution is 256x256.
The baked “Luminous amount” and “Illumination (indirect)” information was used to create a mask for the pulsating effect. The color and frequency of the pulse can be adjusted on the fly.
The final object.
Closing words
I hope that you found this tutorial useful. If there is anything that would need a more detailed explanation, or you have a better way to do something, please let me know, I’ll extend the article accordingly.
You can contact me at zoltan (dot) erdokovy (at) gmail (dot) com .
Part I: The theory - Overview
Part II: The theory - A closer look
Part III: The highpoly object in modo 401
Part IV: The lowpoly object in modo 401