Tutorial Empire Earth Modification Texture Baking - EE-modders/Empire-Earth-toolbox GitHub Wiki

Empire Earth Modification Tutorial: Texture Baking


Authors: v.1.0 - Matthew Hastings (MJHastings#1986)


This tutorial explains how to bake shadows onto images. It assumes a basic understanding of Blender workflow. It also assumes that the model has been cleaned appropriately (if not, the poor bake result will inform you what needs to be cleaned). All cleaning should be done in the original UV Map (see below), else lots of extra work will be required.


Contents:

  1. Load, Asign, and Display the Image
  2. Lighting
  3. Shading Nodes
  4. UV Map
  5. Bake the Texture

Load Asign and Display Image

  • In the Layout tab, ...
    • ... select the desired Object ...
      • ... in the Properties Window, Material Properties < '+' button (Add Material Slot) < '+ New' button (Add a new material) < Surface drop down menu < Base Colour yellow button (pop-up window appears) < Image Texture < Open Image (folder button) (pop-up window appears) < navigate to and select desired image.
      • ... Tab key in the 3D Viewport (switches from Object Mode to Edit Mode) < in the Properties Window, Material Properties < select the correct Material Slot < Asign.
    • ... Shading drop down menu (far right of the 3D Viewport menu bar) < Texture.
  • Repeat the steps above for each different object/image combination.
  • For ground shadows, a flat surface must be added to the .blend file on which the original shadow can be displayed and on to which the new shadow can be projected.
    • In the Layout tab, Add < Mesh < Plane.
      If the shadow is above the other model textures, or there is a tearing effect, move the Plane down.
    • Select the new Plane < N key in 3D Viewport < Z Location = - 0.001.

2. Lighting

  • In the Layout tab, ...
    • ... Add < Light < Sun
    • ... select the Sun < in the Properties Window, Object Data Properties < Light drop down menu < Sun < Strength = 50. This will be reduced before baking, but a higher value makes shadows more obvious.
    • ... in the 3D Viewport, set Viewport Shading to Rendered < N key in 3D Viewport < adjust the sun angle to achieve the desired shadow direction and length.
  • If the intention is to recreate an angle from a previous shadow file, switch between Solid / Rendered Viewport Shading modes to see the original file / rendered shadow.

3. Shading Nodes

  • In the Shader tab, select the desired Object in the 3D Viewport.
  • In the Shader Editor, ...
    • ... Connect the Alpha output from the Image Texture node (orange box) to the Alpha input of the Principled BSDF node (green box). This conveys the transparency information from the Image Texture to the Material.
    • ... Add < Texture < Image Texture (an Image Texture node will appear) < Left-Click in the desired location.
    • ... Add < Input < UV Map < Left-Click in the desired location.
  • In the Image Texture node, '+ New' (Create a new image.) < Name the new Image Texture (' ... _shadowed' might be good) < Size the new Image Texture (the same as the original or larger) . New image texture are plain black by default.
  • Image Tetxtures MUST be square and the pixel count per side MUST be a power of 2 (36, 64, 128, ...), else the game will not be able to work with it.
  • In the UV Map node, select the new UV Map in the empty field < connect the UV output of the UV Map node to the Vector input of the new Image Texture node.
  • As in 1, change the Sun's Strength = 5. This gives a similar light level to the original.

4. UV Map

  • In the UV Editing tab, select the desired Object < in the Properties Window, Object Data Properties < UV Maps < + (Add UV map.) < Select the new UV Map. -It is a good to rename the two UV Maps (Original & Shadowed might be good).
  • In the UV Editor window, select the new Image Texture < Tab key in the 3D Viewport < A key < UV (centre right of the 3D Viewport menu bar) < Unwrap.
  • This new layout is associated with the new UV Map created above; the original layout is associated with the original UV Map.

5. Bake the Texture

  • In the Shading tab, select the desired Object ...
    • ... make sure that the new Image Texture node is selected in the Shader Editor.
    • ... in the Properties Window, Render Properties < ...
      • ... Performance drop down menu < enter the appropriate output resolution.
      • ... Bake drop down menu < ...
        • ... Bake Type < Combined
        • ... Output drop down menu < ...
          • ... Margin = 0
          • ... Clear Image.
        • ... Bake

⚠️ **GitHub.com Fallback** ⚠️