Home Artists Posts Import Register

Content

Hi guys!

In this diary, I'm going to talk about UV and texture baking. This diary comprises the definition, merits, and use cases, alongside how you could put it into practice. Buckle up! Because this is going to be really long!

Definition

UV stands for U and V axis. It is the 2 axes that create the 2D space. The UV map is a map that gives the computer the texture coordinate of the object. 

Baking means saving any generated data into a cache or a file. Texture baking means that we are saving a generated texture into a file.

Why is it called U and Vs instead of X and Ys? 

Because during the early days of 3D, 3D software programmers have a different way of making their software than it is today. Let me give you an example of it.

----------------------------------------------------------------------------

//The early days

//3D space coordinates

float X = 1f;

float Y = 1f;

float Z = 1f;

//2D texture coordinates

//to avoid overriding the 3D space values, we need to create other variables

float U = 1f;

float V = 1f;

----------------------------------------------------------------------------

In the early days, most devs did not know how to create efficient software. It was during an era of no internet since the internet was exclusively used by the US military and Universities under the name "ARPANET". So you cannot just google your way out from the trouble nor have any sort of tutorials existed on the internet. UV coordinates were created as an ad-hoc solution for the problem. As time progresses, the concept of UV stuck because it makes people easy to understand that UV is the axes specifically designed for giving a texture coordinate.

If UV were created in the early 2000s, it would have looked something like this :

----------------------------------------------------------------------------

3DObject Object1 = new 3DObject ();

Object1.3DSpace = new 3DSpace (1f,1f,1f);

Object1.TextureCoordinate = new TextureCoordinate (1f,1f);

----------------------------------------------------------------------------

With that said, the UV map is a map that gives the computer the texture coordinate of the object.

Use Case

UV is always being used for texturing 3D Models. Every 3D model that you've seen on any digital media, from movies to video games, they are all have a UV map.

Assume that you want to wrap a present for your friend's birthday, UV map tells you the cuts and bends that you need to do to wrap your present.

Texture baking is important when you are trying to port the model into other software. Without texture baking, your model would typically have checkered textures to indicate that your model has no texture.

Baking the texture essentially means that you are creating the wrap by yourself, so that not only you could use it for your friend's birthday present, but also can be used for something else. Like using it for your parents' birthday present, your origami projects, or even for your product packaging at your startups. The possibilities are limitless, and you are in control of the wraps.

UV-Texture Baking Correlation

UV map needs to be established first so that Blender could understand where it should paint the object's texture on a 2D Blank Canvas.

Methods

Part A: UV

1. On Blender, go to the UV editing panel in your window

2. Press U to generate (or unwrap) the UV Map from the model

Unwrapping Methods

A. (Default) Unwrap

Default Unwrap is an unwrapping method where the user should make a cut on the 3D model by themselves so that the 3D model can be stretched into a flat surface.

Use case :

This method MUST be used for complex objects, such as:

  • Head
  • Cars
  • Wood-based objects
  • Commercial Plane
  • Trains
  • Electronic Devices
  • Shoes
  • Multi-colored Objects
  • Objects with tints, decals, or texts
  • and more

Assigning a cut (or seams) :

1. Go to edit mode

2. Select the desired edges

3. Press U -> Mark Seam

4. To remove the cuts (or seams), press U -> Clear Seam

5. Once you've done with the seams, press U -> Unwrap

B. Smart UV Project

Smart UV Project is an unwrapping method where Blender will make cuts automatically based on the angle requirements of the user. 

Essentially, if the angle is too sharp, Blender will automatically make a cut.

Relevant Variables :

Angle Limit: The limit where Blender will make a cut on the object if it is getting too sharp to avoid overstretching the texture.

Island Margin: Every Vertex that gets cut off in the UV map is essentially its own island. The island margin indicates how far the parts of the objects are apart from one another to avoid overlapping UV maps.

Use Case :

This method is usually used for :

  • Simple objects with clear edges, like boxes, tables, and pyramids
  • Single-Colored Objects
  • Complex Objects where details do not matter

C. Project From View

Project from view is an unwrapping method where it just straight up peels the surface of the object that faces the camera.

The way it works is like spraying a decal into your car or using an ancient printing press.

Use case :

This method is usually used for:

  • Eye texturing
  • Objects that have decals
  • Clothes that have an image on the front
  • Tattoos
  • Stencils
  • Product Packaging Design
  • Dakimakura

Part B: Texture Baking

1. Go to the render properties

2. Change the Render engine into "Cycles"

3. Go to the Shading Panel

Usually, there are more than 1 textures that you wish to bake, which includes :

  • Primary color (the rest are optional, you could ignore it if you're just started)
  • Metallic properties
  • Roughness/Smoothness Properties
  • Emission/Neon/Glowiness Properties

To bake the primary color (main texture) :

4. Add diffuse BSDF (Shift + A -> Shader)

5. connect it to the material output

6. Change the color similar to the original shader, OR connect the image texture to the diffuse BSDF

7. In render properties, go to bake

8. Change the bake type to "Diffuse"

9. In the "Contributions" Section, disable the "direct" and "Indirect" checkbox

10. Click Bake

To bake the Roughness Map :

4. use any shader (BSDFs) that has roughness properties(Shift + A -> Shader)

5. In render properties, go to bake

6. Change the bake type to "Roughness"

7. In the "Contributions" Section, disable the "direct" and "Indirect" checkbox

8. Click Bake

To bake the metallic Map :

4. Add Emission BSDF (Shift + A -> Shader)

5. connect it to the material output

6. ONLY change THE "V" Value according to the metallic value that you set before

7. In render properties, go to bake

8. Change the bake type to "Emit"

9. In the "Contributions" Section, disable the "direct" and "Indirect" checkbox

10. Click Bake

To bake the Emission/Neon Map :

4. Add Emission BSDF (Shift + A -> Shader)

5. connect it to the material output

6. ONLY change THE "V" Value according to the emission value that you set before

7. In render properties, go to bake

8. Change the bake type to "Emit"

9. In the "Contributions" Section, disable the "direct" and "Indirect" checkbox

10. Click Bake

From now on, you could technically make a single material that encompasses all of the materials that you've made before. 

11. Add a new material

12. Go to shading

13. Add an image texture

14. Select the baked texture

15. Assign the texture to the appropriate slot :

  • Diffuse -> Color
  • Roughness -> Roughness
  • Metallic -> Metallic
  • Emission -> Emission

Whew, that is a lot. From now on, you could technically extract all of the textures on every single Blender model that I've made. You could port it to Unity, you could port it to 3DS max, you could port it to Maya, and you could port my model anywhere. That is all for today guys. I wish you all the best!


Files

Comments

No comments found for this post.