CSC 240: Computer Graphics

Lab 13: Blender wooden cup

in-class

The goal of this lab is to learn how several 3D techniques work in Blender:
  • texture mapping
  • lighting
  • rendering
For this lab, please work with your random partner, with their one or both computers. If you are working on separate computers, make sure both you and your partner are making progress.

Wooden Cup

This part is based on this tutorial: Blender Wooden Cup Tutorial. You are welcome to follow this instead, just make sure to turn off the sound.

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).

  1. Delete the initial cube in Blender using the delete key, and replace it with a UV sphere from the Create menu on the left:

    cup

  2. Next, change the perspective to the 'front' view (bottom left-hand side), and toggle the perspective/orthographic view so that we're in orthographic view. Also change 'Object Mode' to 'Edit Mode' and switch to Wireframe mode:

    cup

  3. Unselect all ('a' key), and use the 'b' key to select a bounding box around the top vertices, then hit delete, and select vertices:

    cup

  4. Use 'b' 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'. Then click on the blue (z) arrow and drag down to stretch out the cup. Then hit 's' again and scale it inward:

    cup

    cup

  5. 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.

    cup cup

  6. Change back to Object Mode and Solid mode, and change the Shading to Smooth (might be default). 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:

    cup

    cup

  7. Next we're going to add a surface for the cup to sit on. In the 'Create' tab, add a 'Plane' mesh, then hit 's' (scale) and type 100 to make it really big. Then go to 'front' view, and use the blue (z) arrow to move the plane down so the cup is resting on it:

    cup

    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.

    cup

    Now change from Blender Render to Cycles Render (top of the screen). Then choose 'Use Nodes', and select an orange color (or any color you prefer):

    cup cup

  8. 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:

    cup

    Now change the size (under Lamp) and strength (under Nodes) as shown below. This is similar to increasing the intensity of the light in WebGL.

    cup

  9. Now we're going to switch the 'View' (bottom left) to 'Camera', which will show us what the camera/eye sees. Change the view, then go to 'View' again and choose 'Properties', the select 'Lock Camera to View'. Then choose 'Properties' again to dismiss this panel.

    cup

    cup

    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 increase the Render samples to 100 (or higher). Then click 'Render' to render the image. It will be a bit slow since it's ray-tracing. Press 'Esc' to return to 3D modeling view.

  10. Texture: finally we are ready for texture. First download this Wood Texture. Then change the screen layout (at the top) from 'Default' to 'Compositing':

    cup

  11. Make sure the cup is selected, then go to the 'Materials' icon (circle) on the right panel. Select 'New' and under Color, select 'Image Texture'. Then click 'Open' and navigate to where your wood texture is located.

    cup

  12. Now go to Edit mode and select all ('a').

    cup

  13. Then go to 'Mesh', and select 'UV Unwrap', and then 'Unwrap':

    cup

  14. You should get something that looks like this:

    cup

  15. Now add the wood texture by clicking on the image icon on the left.

    cup

  16. On the right, switch the mode from 'Solid' to 'Texture'. You can select all the vertices on the left side and hit the 'g' key to move the shape around on the texture.

    cup

  17. Now switch back to Object Mode:

    cup

  18. Then change from 'Texture' to 'Rendered'. This will show somewhat how the image will look when it is rendered:

    cup

  19. OPTIONAL: You might notice that the texture still looks quite smooth. To make it look rougher, you click on the material icon above the texture panel (left side), then drag the 'Color' link on the 'Image Texture' node to the 'Displacement' link on the 'Material Output' node:

    cup

  20. Now switch back to the 'Default' Screen layout, and 'Object Mode'.

    cup

    Click on the Render icon on the right (camera icon). Then go down to 'Sampling' and increase the Render samples to 500. Then click 'Render' to finally render the image. It will be a bit slow since it's ray-tracing.

    cup

  21. Finally, you should see a cup like this!

    cup

    To save the rendered image, go to 'Image' on the bottom left, then 'Save as Image' and you can save the file as a png. You should also save the .blend file, and email both to your partner if you were working on one computer.