teaching machines

HNRS 304.503 Lecture 18 – Complexture

Agenda

  • Valve’s employee handbook
  • how do we assign multiple materials to geometry in Blender?
  • how do we use Blender’s material system to generate textures usable in Unity?
  • what on Earth is bump mapping?

Multiple textures

Your geometry can have materials assigned to independent faces.

  1. Configure your multiple materials. Use the + sign to the right of the materials list to add new ones.
  2. The first material is applied to all faces.
  3. Select the faces you want to which you want to apply a different material.
  4. Select the different material.
  5. Click Assign.

Baking materials and generated textures

Adding texture and material to our objects can be done a couple of ways. We can produce or find 2-D texture images and UV-map our geometry to those textures. Or we can use Blender’s material system.

Discrete texture images make migration to Unity really easy. Our model holds the UV coordinates for each vertex. We import those. We import the texture and apply it to the model.

Materials generated in Blender are not so easily imported. Unity doesn’t read them in. We first must “bake” them to a texture image, which we can import into Unity. Here are the steps to do so:

  1. Configure our material. Blender doesn’t show generated textures in the 3-D view, to my knowledge. I’d welcome correction. Hit F12 while hovering over the 3-D view to render and Escape to return to the 3-D view.
  2. UV map the geometry to a new image. The color and opacity don’t matter. They will get overwritten by the baking process.
  3. Go to the Render menu in the Properties panel.
  4. Expand Bake at the bottom and switch Bake Mode to Textures. The default setting of Full Render will also bake lighting into the texture, which you should probably leave up to Unity if you have a changing scene. Click Bake.
  5. In the UV/Image Editor, you should see the materials get written to the image. Select Image/Save As Image.
  6. Import your model and saved image into Unity.

Adding non-color material

Materials don’t have to effect just color. You can pretend that very simple geometry is more detailed than it is through something called a normal map.

  1. Create your geometry and give it a material.
  2. Add a texture to the material. Change its type to something interesting. Let’s pick Voronoi for now.
  3. Under Influence, uncheck Color. Check Normal.
  4. Bake your texture as described above, but instead of setting Bake Mode to Textures, use Normals. Save your image.
  5. Look at it. It’s pretty.
  6. Import your model and image into Unity. Change your model’s material to Bumped Diffuse. Change your image’s Texture Type to Normal Map. Drag the image onto the model’s material’s normal map texture.

TODO

  • Read Chapter 12. Bring a Q&O sheet.

Haiku

No tattoos for me
I may reconsider it—
When they’re normal maps

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *