COMPUTER AIDED ARCHITECTURAL DESIGN
Workshop 7 Notes, Week of  October 5, 2020

INTRODUCTION TO LIGHTING AND RENDERING

These notes will introduce basic lighting and  rendering through Rhino Render and continue on to more advanced options using the Rhino plugin for V-Ray. Additional notes are provided on the plug-in for Maxwell for comparative purposes only. They are for optional reading only and the techniques are not required for the class.

PART 1. LIGHTING

1. Create a Rhino Model with a ground plane surface and three solids as follows:

simple solids

2. Open the lighting icon from upper right-hand side of screen.

3. Place a spot light in the model from the front view, entering the target and radius first, and then the light location second.

place spot light part 1

 

4. Select the light and turn the control points to on.

5. From the top view, move the lighting source position to the +x, -y position relative to the ground plane.

adjust light source position

5. Activate the perspective window, select the rendering icon, and render the view. Note that the background color in these renderings is black rather than defaulting to white. See the technique discussed later in these notes as to how to change the background color.

one light rendering

6. Following a similar procedure, create a back spot light pointing towards the center of the model and create a rendering.

two lights rendering

7. Select the properties icon for the back light and reduce the shadow intensity to 0 and light intensity to 50.

8. Change the resolution to a mid-level size at 1280 x 720 (16:9) rather than default to the view window size. Note in the last rendering that there are stair step like lines on geometry running diagonally across screen (they are jagged), such as on the cone and the box. To compensate for this problem, which is called "aliasing", change "Quality" to "Good Quality " to set up for a higher quality "anitialiasing" in the dialog window below.

render quality setting

Also, in the same dialog box, to change the background of the rendering, select Background "Solid Color" and select the color swatch (which is white by default in the screen capture below) and change it to black. Select the "OK" button at the bottom of the dialog box to exit back into main modeling mode of Rhino.

change background color

 

Render the perspective window again and note that the second light is no longer casting a shadow and also that now that there is a black background.

key and back lighting

9. Add a point light to the upper left hand corner of the model. Here it is only necessary to position the light source. That is, the point light is an omnidirectional light and doesn't have a target or cone profile. Begin in the front view and continue to place the light in the top view similar to setting the light source locaation for the spot lights.

place point light

10. Using the properties icon, adjust the shadow intensity of the point light to 0 and change the light intensity to 50 (i.e., 50%).

change light intensity

11. Render the perspective again for a rough simulation of three point lighting.

redner 3 pt light

 

PART 2. RENDERING

 

1. You can continue to adjust the antialiasing level by rendering the same model within a more advanced rendeing tool as we will see in a later workshop tutorial.

2. Using the same properties icon as before, set the material colors of the box, cylinder and cone to red, blue and green, and also make the cone transparent. Note that the "Material" pull-down tab is active, that the "basic" assign by method is selected, and that for the cone, the transparency value is set to 0.75. Do not select the "Transparency Check Box" which refers to a separate material property.

set cone to color green

5. Rendering the view to 640 by 480 pixel resolution results in the following jpg file.

6. Download the image of penguins below by right clicking on it and saving it to your local working folder.

 

7. Now select the ground rectangle, open up the properties dialog, select the "material" (tube) icon, select the check-box for "Bump" and also "empty - click to assin" link highlighted in blue in the image below. Load the file above through the map file interface.

 

penguin bump map loading

Render the result.

render bump map for penguin

 

 

8. Within the same dialog box, go to the texture mapping, which looks like a half roled sheet of paper, and select the planar texture mapping icon.

plannar mapping icon

Trace the surface in the ground by a rectangle from the lower-left-hand corner to the upper-right-hand corner.

trace planar projection

Now, continuing in the texture mapping dialog box, adust the "UVW repeat" parameters to 2.0, 2.0, and 1.0.

planar map parameters

Re-render the image and note that the bump map is repeated twice along each axis.

bump map doubled

PART 3: LIGHTING AND RENDERING WITH V-Ray

Part 3 is an introduction to rendering techniques with V Ray. We will introduce basic rendering methods through V-Ray for this first tutorial and then return with more advanced treatments of materials and lighting in the workshops to follow. For a more general guide and tutorial material on V-Ray see https://docs.chaosgroup.com/display/VRAYRHINO

More tutorials and reference materials can be accessed from within Rhino from the menu item V-Ray/Help/Online Help. This menu item links to an online Rhino Help site at Chaosgroup.

For a slightly older  PDF documentation of the V-Ray plugin to Rhino see the V-Ray For Rhino Plugin Manual. However, the user interface has changed and new functionality has been added.

In the later part of this part 3, we will switch to a V-Ray Sun. First, select the sun icon in the Rhino "Render Tools'' and using the pop-up dialog box change the check-box to turn it off.



1.  To change rendering engines from Rhino Render, go to Menu item  Render> Current Render>V-Ray For Rhino

2. Using the same techniques as described above, create a file with a ground plane with  three objects, a box, a sphere, and a cone. 

three objects

3.  Using the VRay lighting tab, create a key light, back light and fill light without determining intensities and other properties.

three objects with lights

4.  Select the spot light in the front right-hand area of the 3D model, and in the properties dialog box, select the "spotlight" icon, and note specifically that the color is white,   intensity is set to 30.0 scalar units (a relative measurement of intensity rather than specific energy units), and that the shadows check-box is on. . Select the "Edit in V-Ray Asset Editor and note the appearance of the dialog box named "V-Ray Asset Editor. 

edit VRay spot light

5. Within the "V-Ray Asset Editor, select the arrow pointing to the right on the midde of the right hand side, and the asset editor expands as shown below. Note again that the color is white,   intensity is set to 30.0 scalar units. Note allso that the cone angle and the penumbra angle are indicated in this expanded view of the asset  editor.

edit spot light properties

6. Select the spot light in the rear back right-hand side (i.e., the back light). Set the intensity to "15" and uncheck the shadows checkbox.

edit back light

7. Now select the point light, and also set the intensity to "15" and the shadows to off.

edit vray point light

8.Select the rotary symbol, 4th from the left, open the "Camera" tab, and select the arrow to the right of the words "Standard Camera" to expand the camara options.

expand camera editor

9. Set the F-number (F-stop number) to 3. The F-number is a number determined by the aperature opening of the simulated camera. A lower number corresponds to a wider aperature opening that increases the exposure to light.  A high F-number corresponds to a smaller aperature opening  and the lowers the exposure to light.  (Note that the actual calculation of the F-number is based upon a the ratio of the focal length to the diameter. That is, F-number = focal_length/diameter. Thus,  the greater the diameter of the opening the lower the F- number. ) Set the Film Sensitivity (ISO)" to 100 and the and the Shutter Speed to 200. 

set camera settings

10. Select the "Perspective" window, choose a desirable view orientation,  and then select the Render Icon (the blue sphere) and render the perspective view.

perspective view

If the rendering is too dark, return to the camera editor, and try lowering the shutter speed or f-stop number. Note that a slower shutter speed means that the shutter remains open and thus admits more light. Conversely, increasing the shutter speed will decrease the amount of light entering the camera.

Alternatively, as described previously, lowering the F-number value of the camera means that the camera aperature is larger and that the camera will admit more light. Conversely, a higher F-number correspondends with a smaller aperature and will decrease the amount of light entering the camera. However, lowering the F-number may be used to increase the depth of field, a measure of how much within the view lies in focus. This is a technique that will be discussed in a later workshop.

11. For another approach, within the V-Ray Buffer Window, turn on the icons in the lower left-hand corner for "show color corrections control",  "color corrections level", and  "use exposure correction" (see icons highlighted by arrows in lower left hand corner of image below).

adjust levels

12. The "show color corrections" icon will open the "Color corrections" window. Within the window adjust the left and right "gradiant" slider (the values at the ends of the range are  0.76 and 9.63  in the image below) to produce a desired contrast and brightness level.

Adjust levels

13. Within Rhino, select in turn each of the lights in the 3D model, and turn off the "enabled" check-box in order to turn off the light.

disable light

14. Go to Render Tab, and toggle off the standard Rhino  "sun" symbol. Next, go to the V-Ray Lights panel and select the sunlight to turn on the Sun control panel.

create vray sun

Within the Sun control panel, set the Sun to "On", and determine the time and day of the year, as well as set the location either by picking a city (e.g., Richmond, VA) or entering the exact latitude and  longitude.

set vray sun position

Hit OK in the dialog box above. Also, at the Rhino command prompt, hit the return key or right mouse button to place the sun light symbol at the origin of the x-y plane.

vray sun at origin

Render to see the impact of the direct sunlight. If necessary, adjust either camera settings and/or the exposure to arrive at a good light level and contrast and turn on "White Balance" so that the color is appropriate to the time of day.  That is, note that the Sun impact on the objects in the Rhino model is tinted to reflect the color temperature of natural daylight.

render sunlight vray

15. To control image resolution, go back to the V-Ray Asset Editor and open the "Rnder Output" tab.

Change the Aspect Ratio resolution to 16:9 widescreen and Image Width/Height to 960 x 540 and test render.  

set output dimension

Render again, and within the V-Ray frame buffer, select the floppy-disk "Save image" icon highlighted below, and save the image to the jpg format.

control resolution vray image

To create materials, return to the V-Ray Asset Editor and select the first icon in the upper left corner.

launch material editor

Within the Material Editor Dialog Box, select the "Add Material" Icon in the lower left-hand corner and choose "Generic Material":

add material create generic material

 

Next, right mouse-button on the word "Generic" and rename the materials glass1.

rename material

Select the "Quick Settings" tab and note the default settings for Diffuse, Reflection,Refraction, Glossiness, IOR (Index of Refraction) and Opacity as follows.

quick settings tab

Select the "Quick Settings" tab and adjust the default settings for Diffuse, Reflection,Refraction, Glossiness, IOR (Index of Refraction) and Opacity as follows.

adjust quick settings

 

Select the sphere, right mouse-button click on the "glass1" material in the "Material List" tab of the asset editor, and choose the option to "Apply Material to Selection".

apply glass to sphere

Return to the "Output" tab of the V-Ray option editor, and with an aspect ratio of 4:3 lower the resolution to 640 x 480, and do a test rendering:

render at 95 % opacity
Return to the V-Ray material editor, adjust the opacity of the glass1 material to 1 and render again.

render 100 percent opacity

Return to the V-Ray material editor, create a generic material "myCone", select the Diffuse layer tab, and change the "Color" to cyan, and assign the color to the cone.

make cyan

Similarly, create a material "myBox", select the Diffuse layer tab,  change the "Diffuse Color" to a light brown, assign the color to the box and render the result.

 

still life with 3 materials

PART 4: CONTROLLING SUNLIGHT AND ENVIRONMENTAL SKY

In this step, we switch from the Rhino Sun to a V Ray Sun. First, select the sun icon in the Rhino "Render Tools'' and using the pop-up dialog box change the check-box to turn it off. If not already active, ensure that the V Ray Sun is turned on and appropriately placed in the Rhino model file.

 

1. Controlling the Sky Color

Return to the V Ray Asset Editor and Settings icon at the top of the dialog box, and open the  "Environment" tab.

settings editor environmental tab



Select the checkerbox icon adjacent GI skylight, and within the V-Ray texture editor, change the "Sun" to "/Sun Light" (the V-Ray sun) and change the "Sky Model" to "Preetham et al', and select the "Back" botton at the bottom of the editor.

GI Sky Edit


Similarly, select the Select the checkerbox icon adjacent to background and also pick the V-Ray sun with Preetham et. al.



 sun as backgroundm

Adjust the perspective view to look at the horizon and render with the the sky background.

background sky with floor

Note, however, that the ground appears to be a field of brown. This is an effect of the sky simulation program.

A simple workaround to this effect is to extend the groundplane so that is occludes the lower part of the background.

background sky with floor

Another technique is to select a color for the background and intensify its value, such as to the number 7 in the setting below, and combine it with the simulated Sky background. However, this begins to step away from a more purely simulated result.

Adjust background color

Adjusted rendering with artifically added blue to sky

2. Return to the  V-Ray asset editor, set the background back to black and intensity one, and under the linked menu for the sky, lower the" turbidity" to value to 2.0 in order to make the sky less hazy, set the ozone to 1, and set intensity to 2, and select the "Back" button..
 
adjust sky parameters

Re-render the perspective view and note the moderately deeper blue color of the sky as compared with the earlier rendering.

adjust rendering

PART 5: PREDEFINED MATERIALS, TEXTURE, BUMP AND DISPLACMENT MAPPING INTRODUCED

1. Working with a predefined materials library.

With the V-Ray asset editor, right  mouse-button click on "Materials" icon (shown below) and select the left arrow to select predefined materails and drag them into the materials list for the Rhino file .  For example, here a type liquid/ocean procedure map is loaded.

add predefined water



Next add the Metal material "Chrome Polished". After loading the material library, the V-Ray asset editor  appears as follows:


add polished chrome

Select the waves and chrome  materials and apply to the ground rectangle and sphere in  Rhino, and re-render.  Note that the predefined water had a bump map assigned to it which in this view looks rather flat. See also the refected sun shape in the chrome sphere.

re-render water and chrome

In the V-Ray asset editor, add a new water as "myWater"  and open up the bump map option.

open bump map tab

Select he texture map (blue checkered icon) and note that a "purlin" noise map was used to create the apparent waves.

purlin bump map parameters

Increasing the frequency to 0.2 can improve the density and apparance of the waves, but the results are still relatively superficial.

adjust frequency

higher frequency rendered

2. Next, to get a more complete solution with real geometry an altenrative option to the bump map is a displacement map. To start, left mouse button click to select the "advanced" option on the material editor highlighted with the green oval below to start a displacement map.

advanced editor switch

Next, left mouse button click on the add attribute icon in the material editor.

add attribute

Use the popup dialog box to add a "displacement map".

add displacement map

Now, within the materiala editor turn off the bump map, and then open and edit the displacement map option.

edit displacement map

Select the blue checked icon to the right of the "Mode/Map" property.

select displacement map icon

Select V-Ray water displacement map.

select water displacement map

Within the bump map editor change the Patch Size to "250"

edit water displacment map

3. In order to established the appropriate scale, at this step it becomes necessary to adjust the texture map to the ground surface. Select the rectangle for the ground in the "Top" view and the properties tab, and go to the Texture Mapping" (orange cylindrical icon) tool.

startTextureMap

Select the Planar Mapping" icon.

apply planar mapping icon

Select the lower-left and upper-right corners of the ground surface with the "End" Osnap filter.

select Corners

Select the "UW" mapping option at the command prompt.

select UW mapping option

In the mapping that follows, change the "UVW repeat" to "5 x 5 X 1" as indicated in the lower right hand corner of the screen capture below.

UW repeat



In the next rendering, the ground plane, and the base of the box and cone are partially submerged in the displacement map for the water  These materials use more advanced " mapping" techniques that create true geometry and that that will be covered in greater depth  in a future workshop.

displacement map rendered


In the next rendering, the "UVW repeat" valeu is changed to "12 x 12 X 1" for a higher density wave patern.

rerender with repeat at 12x12x1