The goal of this lab is to learn how several 3D techniques work in Blender:
- texture mapping
- lighting
- rendering
Wooden Cup
This part is based on this tutorial: Blender Wooden Cup Tutorial and updated to the current version of Blender.
Note 1: if you are having to change the user settings every time you open Blender ('Emulate 3-button mouse' for example), then you can go to 'File' > 'Save Startup File' right after you get the settings they way you want. Then Blender will load the current file whenever it opens.
Note 2: if you are running out of time, I've labeled a few steps as OPTIONAL that are not really necessary for understanding texture mapping, lighting, and rendering (they are simply to make the image more realistic).
Delete the initial cube in Blender using the delete key, and replace it with a UV sphere from the 'Add' -> 'Mesh' menu on the upper left:
Next, change the perspective to the 'front' view (upper left 'View' -> 'Viewpoint' menu), and toggle the perspective/orthographic view so that we're in orthographic view. Also change 'Object Mode' to 'Edit Mode' and switch to Wireframe view (next to the solid circle in upper right):
Unselect all, and use a mouse drag to select a bounding box around the top vertices, then hit delete, and select vertices. The result should look like this:
Drag a box again to select the vertices shown below. Then hit 's' (scale), 'z' (constrain z-axis), '0' (collapse vertices to make bottom of the cub), 'Enter'. To drag it downward hit 'g' then 'z' and move the mouse. Finally hit 's' again and scale it inward or outward as desired:
OPTIONAL: To make the cup look imperfect, from the 'Select' menu, choose 'Random', which will select a subset of random vertices. Then hit 's' for scale, and type 1.02 to make these vertices a little off. Then hit enter. You can even add some loop cuts in the bottom half of the cup first, to make a more uniform grid.
Change back to Object Mode and Solid mode, and change the Shading to Smooth (from the Object menu). Using the wrench tool, go to Add Modifier, and click 'Solidify'. Then change the thickness of the cup as shown below. Then go to Add Modifier again, and click 'Subdivision surface'. Increase the Subdivisions to 3 for both 'View' and 'Render', as shown below:
Next we're going to add a surface for the cup to sit on. From the Add menu, add a 'Plane' mesh, then hit 's' (scale) and type 100 to make it really big. Then go to 'front' view, and move the plane down so the cup is resting on it (you can use the move tool or 'g', then 'z' to restrict the motion):
Now we're going to change the material of the plane. Click the Material icon (looks like a circle, next to the triangle icon). Then select new.
Within the surface properties section, select a base and subsurface color. For example you can choose light and dark orange.
Lighting: Now we're going to modify the light source. First zoom out until you can see the light. Move the light source along the red (x) axis until it is directly over the cup. Then switch the view to 'Right', and move the light along the green (y) axis until it looks like this:
The next set of controls is specific to just one of the possible rendering engines in Blender, called Cycles. We'll need to specify this under the render properties icon (looks like a camera) on the right. Find the drop-down menu for Render Engine and change it from Eevee to Cycles.
Now go to the light properties icon (looks like a bulb) and change the radius (under 'Light') and strength (under 'Nodes') of the light source. This is similar to increasing the intensity of the light in WebGL.
Now from the View menu choose Cameras -> Active Camera, which will show us what the camera/eye sees. Adjust the view until you're happy with it and align the camera to the view as we did in the previous lab.
To see an intermediate image, let's do an intermediate render. Click on the Render icon on the right (camera icon). Then go down to 'Sampling' and make sure the Render samples is set to something more than 100. Then from the Render menu select Render Image. It will be a bit slow since it's ray-tracing. Close the rendering window to return to 3D modeling view.
Texture: finally we are ready for texture. First download this Wood Texture.
Make sure that we're still in Object Mode and the cup is selected, then go to the 'Materials' icon (circle) on the right panel. Select 'New' and next to Base Color, click the circle to select 'Image Texture'. Then click the file folder icon and navigate to where your wood texture file is located.
Now change the mode at the top to 'UV Editing' and select the whole cup ('a'). On the left side you can see the placement of your UV mesh on the wood texture image. You can select the mesh (or pieces of it) and drag them around to change the appearance of the cup. Experiment a bit until you have an intuition for what is happening, and the cup looks the way you want. (You can switch back to Layout mode to see better if you like.)
The default UV mesh isn't actually the best for our purposes, because it separates the points at the bottom center and places a vertical seam in the texture along one side of the cup. (Did you notice that earlier?) We can fix this by building a new UV mesh. First, in the left-hand pane select a single vertex at the bottom, at the tip of one of the triangles. Then hit 'u' and the mesh will re-form around that single node. It should look something like a spider's web. Select the whole mesh ('l' to select all linked nodes). Move this and scale it so that it fits fully on the texture and is aligned with the grain. Now go back to layout mode and admire the results of your work.
OPTIONAL: You might notice that the texture still looks quite smooth. To make it look rougher, you can add a displacement (bump) map. Although we don't have a truly correct bump map for the wood texture, we can re-use the image itself since the darker regions represent hollows.
We'll set up this connection using the Shader Editor. Click Shading mode on the top menu bar, and make sure that the cup is selected. You should see a diagram below with boxes connected by lines. The left box will be woodsample.jpg, and the output labeled Color will have a line to BaseColor in the next box. Select the woodsample.jpg box and make a copy of it (right-click -> 'Duplicate'). Then drag the Color output of the copied box to the Displacement node on the MaterialOutput box on the right. You can move the boxes around for better visibility. The end result should look something like this:
Now switch the mode back to 'Layout', and 'Object Mode'. Your cup should have a roughened surface.
To complete the lab, let's produce a final render. Select the cup, click on the Render icon on the right (camera icon). Then go down to 'Sampling' and increase the Render samples to 512. You should also go to the output icon (looks like a printer) and enter the filename for where you want the output to go.
Finally choose 'Render Image' again from the Render menu. It will be a bit slow since it's ray-tracing.
Eventually, you should see a cup like this!
If you didn't specify a name to save the image file under, you can still do it by choosing 'Save As' under the 'Image' menu. You should also save your 3D blender model from the main Blender window, under the 'File' menu.
If you hit 'z' and select 'Material Preview' you'll get a rough preview of your final render.