Blender

Blender

Not enough ratings
Baking Textures From Blender (Blender Render Mode)
By Pte Jack
A quick guide on the fundimentals of Baking Texture from Simple Blender Materials in Blender Render Mode

Baking textures from Blender materials is pretty simple. It's all in how you lay out your UVs and what you want to bake (ie textures, AO maps, Bump/Normal Maps, etc) Texture sheets can be simple or complex. When the process is complete, the texture sheet you create can be used to minimize the number of materials your model uses.

In this guide I will be using the basic cube model, paint the 6 sides different colours using simple Blender materials, then bake the materials into a single texture.
   
Award
Favorite
Favorited
Unfavorite
Baking Textures
You can paint using brushes making complex textures or use simple solid colours to paint your model in Blender, it doesn't really matter as long as the mesh is assigned to a material.

In this guide I will just use a 6 sided cube and paint each side a diffferent colour using Blender Diffuse colouring in Blender Render mode.

The real secret to this is how you have unwrapped your model and placed the UVs within the UV space. When blender unwraps an object, it tries to make all the mesh it is unwrapping the same scale so the tessulation of the islands is the same within the UV space it uses.
The more space the mesh of an object has in the UV sapce the crisper the detail within that object will be. However, the downfall giving mesh of the object more space in the map is that you're changing the scale of the texture within it compared to the other mesh within the UV space (unless all the mesh is uniform in size inside the map). This can play havoc when a texture has complex detail and your trying to match seams or tiles or other fine details on the object when painting.

Anyway, back to baking textures.

So, to start, mark your seams and unwrap your model.


Once you have the object(s) unwrapped, assign materials to the mesh in the UV space. When assigning materials it is best to do this in Face select mode. This way the whole faces selected will receive the assignment and you're not painting single vetexes or edges.
Turn the "Face Select" mode and the "Keep UV And Edit Mesh Selection in Sync" operators on.

If you find that there is over lapping islands visible in the UV space and you are planning on keeping everything on the same texture sheet, or you're not really happy with the unwrap, then you're going to have to rearange the islands or your model will not paint properly.

With the Cursor hovering in the Image\UV Editor panel, Select all the mesh in the UV Space.
Press Ctrl+P.

This will average the size of the islands based on the amount of space they are currently using, determine if the mesh in the island is welded and then distribute them to use the UV space effectively, attempting to keep the tessulation of the islands equal to the current UV layout.

(Techy Example Stuff - The following GIFs show some of the uses of Using Ctrl+P in the UV/Image Editor to position mesh in the UV Space.)



Next thing we have to do is create an new unassigned texture in the UV/Image Editor.

If you've followed this Tutorial and you have unwrapped the model in the square UV space, the unwrap is based on a square UV Space.

If we create a new image and keep it square, the Unwrap will expand or contract itself to use the texture area based on the size given.

The size you make your texture is determined by the complexity of the texture your going to create in the end. For example, if I were just going to make this cube 6 different colours, without any added detail, I could get away with a texture as small as 64x64. But let's say I'm going to add stuff like panelling or decals, I might consider making a 2048x2048 texture so the detailling can be read or made out clearly.


However, if we create a new image that isn't square, the UVs in the UV space will stretch proportionally to maximize use of the UV space. To get the proper aspect in the new texture space, re-unwrap the model/object and set the Correct Aspect option in the unwrap Options.


Now that the model/object is unwrapped and your're happy with the way the islands are positioned in the UV space, Create a new texture in the image editor to the size of the final texture.

Now assign Materials to the mesh colouring using Blender Diffuse colours, by painting in the image editor or by texture painting the object as you normaly would.


Now that materials have been assigned to the model, the model is unwrapped and there has been an unbound texture create,
1) Select the Render Tab in the Properties Panel.
2) Scroll down to find the Bake panel and expand it.
3) Change the Bake Mode to Textures.
4) Change the Margin parameters to allow overspray of the edges
This will prevent seams from becoming visible when textures are applied to the object. (I usually set mine to around 4 pixels)
5) Setting the Clear Option will cause the bake to erase anything in the texture before baking. If you don't want stuff to be deleted from the texture when baking, uncheck the Clear Box
6) Click Bake and watch the action.



Once the texture has been baked, on the UV/Image Editor menu, select Image, then Save as and save the new texture to your disk drive somewhere. Failure to save the texture will cause the baked texture to disappear from Blender if Blender is closed down or crashes and is restarted. You'll have to rebake the texture if this happens.

Once the texture is saved, you can now use it as an actual texture for your model which will allow you to delete the Blender materials and reduce your material count to 1 instead of 6 (or whatever).


You now have a baked texture for your model that you can use in Blender or the game engine your creating the model for.

Here is a real world example of a model object that uses 9 different materials.



1 Comments
DietCokeZero 28 Oct, 2018 @ 3:04pm 
i know this isnt an sfm post but since youre good at making and porting models i wanted to know if you could port that popular mario model from GMOD please?