|
1 |
| ---- |
2 |
| -uid: tutorial_plastics_3 |
3 |
| -title: Realistic Looking Plastics - UV-Map Mesh |
4 |
| -description: How to UV-map the texture onto your mesh in Blender |
5 |
| ---- |
6 |
| - |
7 |
| -# UV-Map Mesh |
8 |
| - |
9 |
| - |
10 |
| -## Step 1: Create Material Slots |
11 |
| - |
12 |
| - We need three material slots, for the top and bottom faces, as well as for the edges. We'll split the vertices by firstly assigning everything to an "edge" slot, and then re-assigning the top and bottom faces to their own slots. |
13 |
| - |
14 |
| -<img src="blender-material-slots.png" width="235" class="img-responsive pull-right" style="margin-left: 15px"> |
15 |
| - |
16 |
| -In object mode, open *Materials* properties and remove the current material slot (hit `-`). Add three new slots (press 3× `+`), and for each slot, create a new material by hitting the *New* button when the slot is selected. Name them "top", "bottom" and "edge" and set their base color to red, green, and blue respectively. Your slots should now look like in the screenshot. |
17 |
| - |
18 |
| -Set the 3D viewport to *Material Preview*. Select your mesh, press `Tab` to switch to edit mode. Press `A` to select all vertices, select the "edge" material slot, and hit *Assign*. Your plastics should turn blue. Press `A` twice to deselect everything. |
19 |
| - |
20 |
| -Then, press `7` on the numpad to switch to top view, zoom in a bit so you can clearly see the triangles, switch to *Face Select* and click on one face of the top surface: |
21 |
| - |
22 |
| - |
23 |
| - |
24 |
| -<img src="blender-select-coplanar.png" width="280" class="img-responsive pull-right" style="margin-left: 15px"> |
25 |
| - |
26 |
| -Click on *Select -> Select Similar -> Coplanar*, which should result in all top faces of all plastics being selected (but *not* the bottoms ones). However, you might get the bottom faces selected too, because there's a threshold that might be too large. You can check it by rotating the camera and verify that the bottom faces are not selected. If they are, expand the parameters and set the threshold to a small enough value. Then, select the "top" material slot and hit *Assign*. The top surfaces should turn red. |
27 |
| - |
28 |
| -For the bottom faces, hit `7`, `9` on the numpad to switch to bottom view, and select again one face. Like before, select all coplanar faces, click the "bottom" material slot, and *Assign*. You should see the bottom faces turn green. |
29 |
| - |
30 |
| -Now, the "edges" material slot should only contain the edges. Check by unselecting all (`A` `A`), then selecting the "edge" material slot and hitting *Select*. This should only select the edges, like here: |
31 |
| - |
32 |
| - |
33 |
| - |
34 |
| -Your meshes should now be colored like this (from top / bottom): |
35 |
| - |
36 |
| - |
37 |
| - |
38 |
| -## Step 2: UV-Map |
39 |
| - |
40 |
| -Switch to the *UV Editing* workspace. In the left *UV Editor*, choose *Image -> Open*, and select the exported `Plastic-01.png` you've created in part one. On the right, enter edit mode, click on the "top" material slot in the *Materials* property tab, and hit *Select*. Click on "bottom" and then on *Select* again. |
41 |
| - |
42 |
| -From the *UV* menu, select *Cube Projection*. Move your cursor to the left view and press `A`. You should see both the top and bottom surfaces projected onto your texture: |
43 |
| - |
44 |
| - |
45 |
| - |
46 |
| -We're now going to align the projection with the texture. You can do that by using the `G` and `S` keys. What's important is to align the **outer** contour with the texture, like so: |
47 |
| - |
48 |
| - |
49 |
| - |
50 |
| -## Step 3: Prepare and Export |
51 |
| - |
52 |
| -Once done, switch back to the *Layout* workspace. Before we export, there's still a bit of a clean up to do. In edit mode, hit `A` to select all and choose *Mesh -> Clean Up -> Limited Dissolve*. Exit edit mode, go to *Modifier Properties*, add the *Triangulate* modifier, and hit `Ctrl`+`A` to apply. |
53 |
| - |
54 |
| -What we just did reduced the complexity of our topology. We triangulate at the end to avoid problems during export. |
55 |
| - |
56 |
| - |
57 |
| - |
58 |
| -From left to right: |
59 |
| -- Original (102k vertices, 44k triangles) |
60 |
| -- After limited dissolve (66k vertices, 30k triangles, but errors in mesh) |
61 |
| -- After triangulation (66k vertices, 30k triangles) |
62 |
| - |
63 |
| -Switch to the *Object Data* properties, and under *Normals*, enable *Auto Smooth*. This will properly align the normals on the bevel side, giving it a more realistic refraction effect. |
64 |
| - |
65 |
| -We still have one single object, so before exporting, let's split it. In edit mode, hit `A` to select all and choose *Mesh -> Separate -> By Loose Parts*. Before exporting, feel free to rename your objects in the Outliner, it's what you'll see in Unity. |
66 |
| - |
67 |
| -Lastly, in object mode, hit `A` to select all objects and click on *Object -> Set Origin -> Origin to Geometry*. This will set the local origin of each object to the object itself, making it easier to place it. |
68 |
| - |
69 |
| -Export the plastics by selecting *File -> Export -> FBX*. Name it `Plastics.fbx` and hit *Export FBX*. |
70 |
| - |
71 |
| -Now let's [import this into Unity](xref:tutorial_plastics_4)! |
| 1 | +--- |
| 2 | +uid: tutorial_plastics_3 |
| 3 | +title: Realistic Looking Plastics - UV-Map Mesh |
| 4 | +description: How to UV-map the texture onto your mesh in Blender |
| 5 | +--- |
| 6 | + |
| 7 | +# UV-Map Mesh |
| 8 | + |
| 9 | + |
| 10 | +## Step 1: Create Material Slots |
| 11 | + |
| 12 | + We need three material slots, for the top and bottom faces, as well as for the edges. We'll split the vertices by firstly assigning everything to an "edge" slot, and then re-assigning the top and bottom faces to their own slots. |
| 13 | + |
| 14 | +<img src="blender-material-slots.png" width="235" class="img-responsive pull-right" style="margin-left: 15px"> |
| 15 | + |
| 16 | +In object mode, open *Materials* properties and remove the current material slot (hit `-`). Add three new slots (press 3× `+`), and for each slot, create a new material by hitting the *New* button when the slot is selected. Name them "top", "bottom" and "edge" and set their base color to red, green, and blue respectively. Your slots should now look like in the screenshot. |
| 17 | + |
| 18 | +Set the 3D viewport to *Material Preview*. Select your mesh, press `Tab` to switch to edit mode. Press `A` to select all vertices, select the "edge" material slot, and hit *Assign*. Your plastics should turn blue. Press `A` twice to deselect everything. |
| 19 | + |
| 20 | +Then, press `7` on the numpad to switch to top view, zoom in a bit so you can clearly see the triangles, switch to *Face Select* and click on one face of the top surface: |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | +<img src="blender-select-coplanar.png" width="280" class="img-responsive pull-right" style="margin-left: 15px"> |
| 25 | + |
| 26 | +Click on *Select -> Select Similar -> Coplanar*, which should result in all top faces of all plastics being selected (but *not* the bottoms ones). However, you might get the bottom faces selected too, because there's a threshold that might be too large. You can check it by rotating the camera and verify that the bottom faces are not selected. If they are, expand the parameters and set the threshold to a small enough value. Then, select the "top" material slot and hit *Assign*. The top surfaces should turn red. |
| 27 | + |
| 28 | +For the bottom faces, hit `7`, `9` on the numpad to switch to bottom view, and select again one face. Like before, select all coplanar faces, click the "bottom" material slot, and *Assign*. You should see the bottom faces turn green. |
| 29 | + |
| 30 | +Now, the "edges" material slot should only contain the edges. Check by unselecting all (`A` `A`), then selecting the "edge" material slot and hitting *Select*. This should only select the edges, like here: |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +Your meshes should now be colored like this (from top / bottom): |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +## Step 2: UV-Map |
| 39 | + |
| 40 | +Switch to the *UV Editing* workspace. In the left *UV Editor*, choose *Image -> Open*, and select the exported `Plastic-01.png` you've created in part one. On the right, enter edit mode, click on the "top" material slot in the *Materials* property tab, and hit *Select*. Click on "bottom" and then on *Select* again. |
| 41 | + |
| 42 | +From the *UV* menu, select *Cube Projection*. Move your cursor to the left view and press `A`. You should see both the top and bottom surfaces projected onto your texture: |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | +We're now going to align the projection with the texture. You can do that by using the `G` and `S` keys. What's important is to align the **outer** contour with the texture, like so: |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | +## Step 3: Prepare and Export |
| 51 | + |
| 52 | +Once done, switch back to the *Layout* workspace. Before we export, there's still a bit of a clean up to do. In edit mode, hit `A` to select all and choose *Mesh -> Clean Up -> Limited Dissolve*. Exit edit mode, go to *Modifier Properties*, add the *Triangulate* modifier, and hit `Ctrl`+`A` to apply. |
| 53 | + |
| 54 | +What we just did reduced the complexity of our topology. We triangulate at the end to avoid problems during export. |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +From left to right: |
| 59 | +- Original (102k vertices, 44k triangles) |
| 60 | +- After limited dissolve (66k vertices, 30k triangles, but errors in mesh) |
| 61 | +- After triangulation (66k vertices, 30k triangles) |
| 62 | + |
| 63 | +Switch to the *Object Data* properties, and under *Normals*, enable *Auto Smooth*. This will properly align the normals on the bevel side, giving it a more realistic refraction effect. |
| 64 | + |
| 65 | +We still have one single object, so before exporting, let's split it. In edit mode, hit `A` to select all and choose *Mesh -> Separate -> By Loose Parts*. Before exporting, feel free to rename your objects in the Outliner, it's what you'll see in Unity. |
| 66 | + |
| 67 | +Lastly, in object mode, hit `A` to select all objects and click on *Object -> Set Origin -> Origin to Geometry*. This will set the local origin of each object to the object itself, making it easier to place it. |
| 68 | + |
| 69 | +Export the plastics by selecting *File -> Export -> FBX*. Name it `Plastics.fbx` and hit *Export FBX*. |
| 70 | + |
| 71 | +Now let's [import this into Unity](xref:tutorial_plastics_4)! |
0 commit comments