Friday, September 16, 2016

3D Project: Cornell Box

For this project you will be getting more familiar with the workflow and methods in using Autdodesk's Maya to create a 3D scene with objects, lighting, a camera and textures. You will then render this scene and adjust quality, then render an animation to learn the basics of keyframing and render settings as well.


Cornell Box Project: Lights, Camera, Action!

History of the Cornell Box: The Cornell Program of Computer Graphics has become best known for its research on physically based rendering. They believe that computer graphic simulations will never become predictive of reality unless we correctly model the physics of light reflection and energy propagation within physical environments. The Cornell Box experiments have come to symbolize our approach to physically based rendering, it is a simply physical environment for which they have measured lighting, geometry and material reflectance properties. Digital, or synthetic images of this environment are created and compared to confirm accuracy of our simulations with 3D software.

A photograph of the original physical Cornell Box.
For this project you will create a scene to simulate the Cornell Box. You will create an environment, objects, textures, a light source and explore the rendering software available in Maya to try and recreate the photo we see above.

A Cornell Box created by Seth Wilson using Maya. This scene contains the famous Utah Teapot. Textures are made with blinn, lambert, phong, the light is a point light using depth map shadows, the scene was rendered with Mental Ray
Cornell Box Project Part 1: Creating The Scene
  1. Open Maya and create a new scene
  2. Create a cube that is perfectly square, turn on Component Selection and delete the front face of the cube so you have a box
  3. Create 2 more cubes and scale/stretch and move them into position to act as your pedestals in the scene
  4. Create a cylinder, sphere, triange or cone and other primitive objects and arrange them in your scene as above using the move and scale tools
  5. Create a cube and flatten it with the scale tool, position it on the roof of your box to act as a "light" later on
  6. Open your Hypershade window (Window Menu/Rendering Editors/Hypershade) and create 2 materials using the Lambert material, make one have a red color and one green. Double click the material to see the material settings
  7. Select your box and turn on Component Selection, select the right face inside the box and apply your red Lamber material, then select the other side and apply the green Lambert material. Select the face first, then right-click on your Material and choose "Assign Material to Selection" to apply it to that face
  8. Create a point light and move it to the top of the inside of your box using the move tool. Turn on "Use All Lights" in your view options to see it affect your scene
  9. Render your scene and check the quality, if your light is illuminating the scene your are doing great!
  10. Close your Render Window
  11. Open your Hypershade window again and create different materials for each of the objects in your scene, try a blinn, a lambert, a phong and try creating a 2D texture such as a checkerboard patter
  12. Select an object first, then right-click on your Material and choose "Assign Material to Selection" to apply it to that object
  13. To make your roof light cube glow, create a blinn material and set it to have a white color, set the illumination to half way to make the object bright, scroll down to the Special Effects section of the blinn material and set the Glow Intensity to 0.010 and apply the blinn to your roof light cube
  14. Under the Create menu, create a Camera
  15. Change your view point to see through your camera, it will be called Camera1 and it is under the Perspective submenu in the Panel menu of your view window
  16. Center your camera to view your scene straight on
  17. Click the render button to see what you get! Compare with your classmates results


Cornell Box Project Part 2: Render Settings

  1. Your scene may not look like mine yet, that is because we must change some render settings for best results. Go to the Window Menu and under Rendering Editors choose Render Settings and you will see the Render Setting Dialog Box
  2. Under the "Common" tab scroll down to Image Size and set it to 1K square, this will make your render square, notice there are other settings for different resolutions, such as common HD video and film dimensions
  3. On the top of the dialog box, there is a pull-down menu next to the text "Render Using", change the pull down menu to Mental Ray, now there are new tabs available to peruse
  4. Under the Quality Tab choose Final Gather, open up the Raytracing section and set reflections and refractions to 10, Max Trace Depth to 20, Shadows to 2 and Blur Limits to 1
  5. Under Features make sure that Global Illumination, Raytracing, Final Gathering, Shadows are all checked on, along with the other defaults
  6. Under the Indirect Lighting tab make sure Global Illumination is checked on, set Accuracy to 500
  7. Under the Indirect Lighting tab make sure Final Gathering is Check on, Accuracy set to 1024, Point Density to 1.00
  8. Under the Indirect Lighting tab, open Final Gathering Map, set Rebuild to On
  9. Its a good idea to save these render settings as a Preset so you can call them up again later for other projects
  10. Now close the Render Settings, save your file
  11. Click the Render button and see what kind of results you get, there should be a serious improvement over the previous render
  12. Save your render as an image from the Render window to look at later so you can lean back and admire your hard work!




Part 3: How To Use Set Up a Project for Rendering in MentalRay and use Image Based Lighting

Step 1: Load Mental Ray

  • Open up your Maya file and go to Window Menu / Settings and Preferences / Plug-in Manager
  • Scroll down in the Plug-In Manager and find Mayatomray.bundle then click load/auto-load and close

Plug-In manager in maya

Load Mayatomray.bundle to enable Mental Ray

Step 2: Set Up Your Project Folder

  • Go to File Menu / Project Window
  • Click New and Navigate to your Project Folder (you should have this already created)
  • Click Accept
  • Go to your project folder through the finder and confirm that the folder structure was created

Project Window in Maya

Your project directory should show all these folders and files
Step 3: Set Up Image Based Lighting

  • Search online for HDR Probe or go to this link and download an image probe that is suitable for your scene
  • Place your HDR Probe or Enviroball Image into the Source Images folder of your Maya Project Directory
  • In Maya open your Render Settings by going to Window Menu / Render Editors / Render Settings
  • Go to the Indirect Lighting tab and click the Create button next to Image Based Lighting
  • An Attributes Window will open for your Image Based Lightning node, click on the folder next to the File Name area and navigate to your Source Images folder and select your HDR Probe
  • In the same Attribute Window scroll down to Render Stats and uncheck the option for Primary Visibilty, this will make your Probe lighting show up in reflections but not in the background of your rendered images
  • Your should see an Envirosphere in your maya scene, create a test render to see it interacting in the reflections on your objects
  • Render a large resolution image and save it to your folder for credit

HDR Probe courtesy of Paul Debevec

Maya's view window with an Image Based Lighting setup
3D Objects rendered with Image Based Lighting in Maya, no actual lights were used in this scene

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.