Lesson 03 Shaders and Textures

Posted on Posted in Foundation 2008

Hiding the General UI

  1. Use lesson 02 file
  2. Turn off all menus/show all menus
    • – Switch to perspective view
    • – press and hold [SPACEBAR] over stage
      • Click on Hotbox Controls > Window Options > (check) either (Show Main Menubar or Show Pane Menubars)
  3. Turn off all workspace options / turn on stage fullscreen
    • HOTBOX CONTROLS || Display > UI Elements > Hide All UI Elements

  4. Change the Panel Organization to Preset Configurations
    • – Press and hold [SPACEBAR] over the stage
    • – Click above the HotBox
    • – Select Hypershade/Render/Persp
  5. Open the Attribute Editor
    • – Press CTRL + A or MAIN || Display > UI Elements > Attribute Editor

Hotkeys / Shortcuts

(For the complete set of Hotkeys: Windows > Settings/Preferences > Hotkey Editor )
  • LAYOUT
    • HotBox/window Popping: SPACEBAR
    • Showhide Attribute Editor: CTRL + A
  • MANIPULATING
    • Select: Q
    • Move: W
    • Rotate: E
    • Scale: R
    • Show Manipulator Tool: T
    • Invoke last Tool: Y
    • Repeat Last Command: G
    • Start / Stop Playback: ALT + V
    • Go to first frame: ALT + SHIFT + V
    • Frame Selected: F
    • Frame All: A

Shading Network

Adding color, texture, light and geometry to an object to give it your desired look is done thru shading networks.

The Hypershade Window

  1. Has 3 sections; (Create Bar | Hypershade Tabs | Work Area)
    • Create Bar: allows you to create any rendering nodes for your scene
    • Hypershade tabs: Lists all the nodes that make up your scene
    • Work Area: allows you to look more closely and alter any part of your shading network’s graph

Creating Shading Networks

Contains a series of nodes that input into a shading group. A shading group is a node which defines the various rendering attributes of it’s related objects, i.e. surface shading, volumetric shading, displacement shading, etc

  1. Build Sky Material
    • – open Hypershade and Attribute Editor
    • – Click on Show top and bottom tabs in the Hypershade
    • In the Create Bar section, Click on the tab Create.
    • Click on the down arrow just below the Create tab, make sure Create Maya Nodes is selected
    • Click on Lambert
    • Lambert gives control over flat materials without shiny highlights
  2. Rename the material node
    • – In the Attribute Editor rename the material node to skyM
    • – “M” is to remind you this node is a material node
    • – Hold CTRL + DBL CLICK on the node in the Hypershade to be able to rename it there.
  3. Edit the Material’s Color
    • To define  how our material will render, you will need to set a color attribute
    • – In the Attribute Editor click on the color swatch next to Colorattribute
      • (This opens a color chooser)
    • – Choose a light blue and click on Accept
  4. Assign the Material
    • MMB + CLICK DRAG on the skyM node from the Hypershade Panel into the perspective stage and drop in onto the skyDome
    • Note: make sure Hardware Shading is turned on. Press 5.

Creating a Procedural Texture Map

  1. Rock Material
    • – In the Hypershade, clear the graph. Click HYPERSHADE WINDOW || Clear Graph or press the clear graph button
    • – This clears the workspace so you can start a new shading network
    • – Create a Blinn material. CREATE [tab] > Blinn
      (Blinn gives you shininess of your material
      )
    • – Change the material node to rockM in the Attribute Editor Window
    • – Select every rock in the scene.
    • – RMB on your rockM and select Assign Material to Selection
    • – With rockMselected, change the Specular Shading values in the Attribute Editor Window
      • Eccentricity: 0.8
      • Specular Roll Off: 0.3
      • Specular Color: Brown
      • Reflectivity: 0
  2. Adding a Fractal Texture
    The rocks look flat because they don’t have a grainy texture. Adding a fractal texture will help enhance the look of grainy-ness

    • – In the Hypershade > Create [tab] > 2D Textures
    • – MMB drag a fractal node into the work area
    • – In the work area MMB + DRAG the fractal icon over rockM
    • – When you release another window will pop up. Select color.
    • – Click Rearrange Graph button.
    •  
  3. View the texture
    (you need to enable Hardware Texturing, if you can’t see the texture on the stage)

    • – Press: 6 or …
    • Hotbox (popup) > Shading > Hardware Texturing or
    • – CLICK on the button
  4. Edit the Fractal Attributes
    • – Click on the Fractal node
    • – In Attribute Editor, CLICK on Color Balance to expand the attributes
    • – Color Gain (swatch color): pick a color
    • – Color Offset (swatch color): pick a color
    • – In Attribute Editor, CLICK on Fractal Attributes
    • – Adjust the values to your preference
    • – At the top of the Attribute Editor Window, Click on the place2dTexture tab. (This tab shows different placement options for the fractal texture)
    • – Change the fractal’s placement attributes
      • Repeat U: 2
      • Repeat V: 1
  5. Display the whole shading group
    • With the rockM selected, Click on Input and Output Connections

Map a File Texture

Create a texture for the ground using a file texture node. Use a file for a texture.

  1. Create a material for the ground
    • – In the Hypershade, clear the workspace
    • – Scroll to the Create[tab] > Surface and select Lambert
    • – Rename this node to groundM
  2. Create a file texture node
    • – DOUBLE CLICK on groundM in the Hypershade to display the Attribute Editor
    • – Attribute Editor Window || Click on the Map (checkered box) icon next to Color
    • – A Create Render Node window pops up
    • Create Render Node window || Click on Textures > 2D Textures > File
    • (you will see this layout in your hypershade work area)
  3. Import the file texture
    • – Click on the file1 node in Hypershade to bring it up in the Attribute Editor window
    • – Click on the yellow folder next to Image Name
  4. Apply the textured material to the ground
    • – Select the ground surface on the stage
    • – Hypershade window RMB CLICK + Assign Material to Selection
  5.  Roof Texture. Using file textures with an alpha channel or transparency
    • – Save a texture image as a TIFF file with a alpha channel
    • – Create your image in Photoshop
      • – Create a selection of your object. CTRL + CLICK on the Layer’s thumbnail
      • – Channels Window, click on Save selection as channel.
      • – Save file as Tiff with Alpha Channels checked and Layers unchecked
      • – Tiff Options window: make sure Save Transparency is checked.
  6. Complete the Scene
    • – Assign textures to the rest of the scene.
    • – Note: you can assign textured to polygonal faces by first selecting the faces and then assigning them the shader.
    • Ex.

Test Render

  1. Display the Resolution Gate
    • The current view panel may not be displaying the actual proportions that will be rendered. To see how the scene will actually render
    • HotBox [SPACEBAR] || View > Camera Settings > Resolution Gate
    • – The view displays a bounding box for 640×480
  2. Render your first scene
    • – In the Render View Panel || RMB(CLICK) + Render >  Render > perspective from the popup
    • – Add lights. MAIN || Create > Lights
    • – Render your scene again
  3. Zoom into your rendering
    • – In the Render View Panel: use ALT + LMB/RMB to pan/zoom our render
    • RENDER VIEW PANEL || RMB [CLICK] + View > Real Size