Presentation is loading. Please wait.

Presentation is loading. Please wait.

SE 313 – Computer Graphics Lecture 11: Projection Painting and Merging Textures Lecturer: Gazihan Alankuş 1.

Similar presentations


Presentation on theme: "SE 313 – Computer Graphics Lecture 11: Projection Painting and Merging Textures Lecturer: Gazihan Alankuş 1."— Presentation transcript:

1 SE 313 – Computer Graphics Lecture 11: Projection Painting and Merging Textures Lecturer: Gazihan Alankuş 1

2 Quiz Turn off monitors Take out a piece of paper and a pen/pencil 5 minutes 2

3 Texture painting with the clone tool We have seen – Texture painting on 3D objects – Using Bprojection and the clone tool to use parts of images on our models. Clone tool demonstrated in Gimp 3 Cursor Start drag Cursor mimics drag path Copies current location under cursor

4 Texture painting with the clone tool Great for using details in parts of images Precise matching can be difficult to master 4

5 Texturing in Blender While Bprojection and the clone tool are great for collecting parts of your texture from different images, getting the whole texture of a model from an image requires more precision We will learn projection painting and merging textures for different points of view to create more precise textures 5

6 Projection Painting in Blender The idea – Get photographs of the object from different angles – Paint them on the object as different textures – Merge them together 6

7 Projection Painting in Blender The idea – Get photographs of the object from different angles – Paint them on the object as different textures – Merge them together 7

8 We will continue with our ice cream truck example 8

9 Getting the model ready for texturing We will repeat what we did last week in the following slides (slides 10-26) 9

10 Modeling a truck The initial cube has material on it, remove it and add a new cube 10

11 Modeling a truck Press tab to go to edit mode. Hit A to select all. Press subdivide to add more vertices and edges 11

12 Modeling a truck Select faces in the front (multi-select with shift) and do “extrude region” – If you do “extrude individual” they would be two separate pieces 12

13 Modeling a truck Select and move around edges and faces to make it look more like a truck Feel free to play with other mesh tools to make it better-looking 13

14 Preparing for texturing While it’s simple, we’re happy with our model. Now let’s prepare it to be textured. You have to do these steps to put textures on your models. 14

15 Preparing for texturing First we need to unwrap our model. This maps the 3D model to 2D. Since images are 2D, this will help us cover the model with parts of an image. This is called texturing. Earlier in the semester we saw that we can mark seams in our model to unwrap it nicely. – Now we will take a more practical approach and use automatic unwrapping 15

16 Preparing for texturing While in edit mode, select all by pressing A and making everything orange. Click on unwrap to bring up its menu Beside “Unwrap” there are many other options. Select Smart UV Project. 16

17 Preparing for texturing To see things better, on top of the screen click on the layout button and select UV editing. This will open the image editor on the left. There we see where the selected faces are mapped. Since we selected all, we see them all. 17

18 Preparing for texturing While the unwrapped model is a bit discontinuous, we do not care. We will draw on the model itself and will not care how they are located in the 2D image. 18

19 Preparing for texturing Now add an image. You can choose to initialize it with the UV test grid to understand which parts of the image is mapped to which parts of the model. Name the image well. “truck texture” is what I wrote. 19

20 Preparing for texturing Scroll out and you will see your image initialized to the UV test image Under the 3D view on the right, select “texture” to see the texture on the model 20

21 Preparing for texturing Go back to the default layout to have more screen area for setting up the material. Even though we are seeing the texture on our truck, we have to also set the texture as a material on the truck for it to work 21

22 Preparing for texturing On the properties pane, go to the material tab Add a new material if there isn’t already one there 22

23 Preparing for texturing Now go to the textures tab and add a texture to this material if there isn’t one already 23

24 Preparing for texturing Set the type of the texture to “Image or Movie” Scroll down and browse for the image that we created earlier Under mapping, select UV for Coordinates 24

25 Preparing for texturing Congratulations, you have successfully added the texture to the model. Here are the things you can do to verify that you have done everything correctly: – Render and see the texture on the model – Select texture in viewport shading and see the texture in the 3d view 25

26 Preparing for texturing Next we will start painting the texture. Before that, we will save the texture image. An early reminder: don’t forget to save the image every time after you paint. File->Save’ing the.blend file is not enough. 26

27 Reviewing the model Now our model is unwrapped nicely and has a simple texture on it We can remove the light in the environment if some faces of our truck are black – But then when you render it will all be black – Here is how you can fix it: 27

28 Projection Painting in Blender The idea – Get photographs of the object from different angles – Paint them on the object as different textures – Merge them together 28

29 Reviewing the model Go to the Object Data tab while the truck is selected There you see a section called UV Maps – This is where the unwrapped UV coordinates are stored – We will have more than one of these for different angles. Rename this to “Main UVMap” 29

30 Adding a new UV map Add a new UV map by clicking the plus button Rename it to Front 30

31 Adding a new UV map In the image editor, we still see the old UV map and the image. This is because we created an exact copy of it To verify this, move one of the vertices in the image editor Switch between Main UVMap and Front. You will see that you edited Front and not Main UVMap 31

32 Using a photo as a texture image Now we want to load the front image for the truck and map it to the front of the truck. Select Front from UV Maps Open the image for the front Now we want to place the vertices in the image editor such that they match the photo 32

33 Using a photo as a texture image In the 3D view, turn the view so that our truck is oriented the same way as the truck in the photo Now select all, click Unwrap and Project from View 33

34 Using a photo as a texture image The vertices started really small. You will always have to resize and locate them by hand Select all (“A”), press “S” on keyboard to start scaling Press “G” to start moving, and “R” to start rotating if you need to 34

35 Using a photo as a texture image Now lets ignore the faces that we cannot see. In the 3D View, deselect all Select the visible edges by clicking and dragging the mouse In the image editor we will only have these visible 35

36 Using a photo as a texture image Now move around individual vertices in the image editor so that they match the photo You don’t have to get everything. Don’t get any background inside the model. You can view the result as you drag 36

37 Using a photo as a texture image While this was good for the front of the truck, the side is not so good. We will get the side from another texture later. First, let’s get the back just like the front 37

38 Using more photos To get the back of the truck, we will create a new UV Map Create a new UV Map and rename it to Back. Again, it duplicated the current UV Map. Load the back image in the image editor. We will need to do another unwrap for this 38

39 Using more photos Turn the 3D view so that the back of our truck is in a similar orientation as the photo In the 3D view, in edit mode, select all Select Unwrap and Project From View 39

40 Using more photos Again select all (A), scale (S), rotate (R), and move (G) the points. Select only the visible faces of the truck and move individual points to match the photo 40

41 Doing the sides from one photo Now for the sides of the truck, we want to create another UV Map Load the side photo Orient the truck and Unwrap, Project From View Select only the visible faces and adjust the UV coordinates 41

42 Doing the other side from the same photo Turn the other side of the truck. Orient it similarly to our photo. Select only the faces on this side (deselect with “A” and select one by one) Unwrap, Project From View again. This will not touch the other side that is not visible. 42

43 Doing the other side from the same photo In the image editor select all (A) and mirror these vertices so that they look more like the photo Adjust and match the photo 43

44 Doing the other side from the same photo Now both sides of the truck are done in this UV Map 44

45 Using multiple texture images Now we have three different UV Maps that all texture only parts of the model 45

46 Projection Painting in Blender The idea – Get photographs of the object from different angles – Paint them on the object as different textures – Merge them together 46

47 Using multiple texture images Problem is, we need only one texture. – Now we want to merge them into one single texture. We will copy parts of each texture into the Main UVMap 47

48 Merging textures For this, we will again use texture painting and the clone brush tool. Select the Main UVMap from UV Maps and switch to texture paint mode On the left, select the clone brush 48

49 Merging textures Similar to Bprojection, where we cloned visuals from a plane, now we will clone from the other UV maps that we cannot see. – We will not place a cursor, it will handle all that itself. Scroll down to the Project Paint section. It should already be checked. 49

50 Merging textures The Clone property here lets us clone from other UV maps We will start by cloning the front of the truck from the “Front” UV map. Check Clone and select the “Front” UV map that you created earlier. Also, increase the strength of the brush 50

51 Merging textures Now when you click and drag on the model, it will bring in parts of the Front UV map. Paint the whole front like this This way, we will bring in parts of the truck from different texture mappings 51

52 Merging textures Select “Back” and start painting the back. 52

53 Merging textures Select “Sides” and start painting the sides. Be careful not to paint over the front or the back. If you do, press Ctrl+Z to undo. – Tip: zoom in so that you can’t see other faces Paint both sides 53

54 Merging textures This looks better than what we did last week. 54

55 Painting the rest However, the top and the bottom are not painted. 55

56 Painting the rest We can select a color and paint these, but it would be difficult to choose the correct color. You can get the value of the color in external programs like Gimp if you want and use that. I will do something that’s more hacky. 56

57 Painting the rest Select the clone brush, Ctrl+click on the model where you have color that you want for the top of the model. The cursor will go there. Now deselect Clone so that we don’t copy from other UV maps Make your brush smaller and paint on top of the truck with very short strokes 57

58 Painting the rest Now that we got some color on top, get the cursor there with Ctrl+click and continue to paint from there Let your strokes move away from the cursor. This will avoid messing it up. 58

59 Painting the rest Paint the bottom to black with the regular brush tool 59

60 Finishing up Now if you want, you can remove the “Front”, “Back” and “Sides” UV Maps but you don’t have to. When you select “truck texture” in the image editor, you should see your truck unwrapped and textured nicely. Save it next to the blend file. 60

61 Finishing up Now when you drag the model and the texture into Unity, you should see it textured fine. 61

62 No homework Work on your projects! 62


Download ppt "SE 313 – Computer Graphics Lecture 11: Projection Painting and Merging Textures Lecturer: Gazihan Alankuş 1."

Similar presentations


Ads by Google