Tutorial 11: Environmental

Completion time 30 minutes

In Tutorial 8 we demonstrated the creation of reflective metallic materials, such as chrome and gold. These materials used images as "Reflect Textures" to create the appearance of reflectivity, even though these materials weren't actually reflecting their surroundings. Renderize Live also includes the ability to create true environmental reflection maps, using the Floor, Spherical and Cubic reflection mapping types. In this tutorial you will learn: The difference between the different reflection mapping types How to generate a Spherical Reflect map How to balance and reflection strength on a reflective material How to create new material assignments to isolate flat surfaces on which to generate a Floor Reflect map How to create a Floor Reflect map The size at which environmental reflection maps are generated How to Save reflection maps Limitations of reflection maps How environmental reflection maps are affected during view animation

Environmental Reflection Mapping Types

Renderize Live supports three different environmental reflection mapping types, each used under different conditions:

The Floor Reflect mapping type is used to generate reflections on flat surfaces, such as a floor, table or window pane. The material for which a Floor Reflect map is created must exist on only one plane in order for the reflection map to be correctly generated. The Spherical Reflect mapping type is used to generate reflections on any curved or rounded surfaces, such as balls or bottles. A material containing this kind of reflection map can only be assigned to one object. If it is assigned to multiple objects, the resulting reflection map may be incorrect. This kind of reflection map is generated relatively quickly and gives a satisfactory environmental reflection. The Cubic Reflect mapping type is used under the same conditions as the Spherical Reflect mapping type: that is, for curved or rounded objects. The two

Tutorial 11: Environmental Reflection Mapping 127 mapping types differ, however, in that the Cubic Reflect mapping type takes about six times longer to generate, but it creates a more accurate reflection. Cubic Reflect is best used when generating a reflection map that is going to be included in an animation. Cubic reflection maps will update as the camera moves during an animation, whereas Spherical Reflect maps will remain static.

Spherical Reflect

Regardless of the mapping type you choose to use, the basic procedure is the same: define a reflective material and assign it to an object in the current view, then calculate a reflection map for that material, based on the position and orientation of the object on which this material is assigned. Before we proceed let's load a new project. Restart Renderize Live. Load the project "tutor11.eye". Drag and drop the view "table" into the View Well. Set "Test:1" and select the button on the Render Toolbox.

Now let's change the generic reflection on the dome to one which will reflect both the tabletop on which it rests and the goblet next to it. To do this we'll use Spherical Reflect. Load the material "dome" into the Material Designer. The material "dome" currently uses a simple image reflection with the image "ref_map" used as the Reflect Image. Select the "Spherical Reflect" Illumination Type. The Material Designer updates with a "Percent Reflect" dial and a "Calculate" button. All environmental reflection maps are generated by rendering the current view from the vantage point of the object on which the material is applied. The "Calculate" button starts the rendering process for these images. Before an environmental reflection map can be calculated for a material, the material must be assigned to an object in the current view and that object must be set to be "smoothed" by selection in the Object Designer.

Let's generate an environmental reflection map for this material. Select the "Calculate" button. Note the status bar of the Project Designer. It reports the rendering progress for the calculation of the reflection map. When complete, the newly calculated image, dome_ENV, appears in the Reflect Texture Well of the Material Designer. This "calculated" image is exactly the same as any other image resource. Set the Percent Reflect dial to about 0.70. Percent Reflect is not used in the calculation of the reflect image. It is used to control the intensity of the reflection in

128 Tutorial 11: Environmental Reflection Mapping the material. When set to 1 the reflection will be the strongest. Save the Material "dome" and confirm "Replace". Minimize the Material Designer. Using the left mouse button, drag a bounding box around the dome in our view. Select the button to perform an area rendering within the rectangle that we just defined. Now that we've set a nice reflection on the dome, let's set one on the goblet. Load the material "goblet" into the Material Designer. Select the "Spherical Reflect" Illumination Type. Select "Calculate". By replacing the image "blend" that was previously used as the Reflect Image, we've lost the element which provided the color to the goblet. Before we save this material let's return some of the color it originally had. We will use the Matte Color to do this. Select . Change the Matte Color Well to HSV values 280, 0.5, 0.5. Reduce the Percent Reflect to .40. Save the Material and confirm "Replace". Close the Material Designer. Select the button on the Command Bar to open the Render Toolbox.

Now let's render the goblet and the dome to see how our reflections appear. This time, instead of performing an area rendering, we'll turn off all the objects in the view except the goblet and the dome. The easiest way to do this is to turn off all of the objects globally, then turn on the goblet and render it.

Select the button on the Resource Manager to display the Object Resource Palette. Select on the Objects pop-down above the Resource Palette and choose the "Turn All Off" option. Position the pointer to cover the object "dome", press the right mouse button to display a menu of options, and select the "On" option. Repeat this process to turn on the object "goblet". Now all objects are temporarily turned off during rendering, with the exception of "goblet" and "dome". Select the button on the Render Toolbox. Now only the goblet and the dome are rendered. Notice that this speeds up the rendering process substantially. Use this method of selectively rendering objects to speed up the overall design process.

The material on the dome reflects nicely, but there is some room for subtle improvement. If you look carefully you may notice that the dome does not seem to be shaded. There is a uniformity across the object that seems unnatural. This is

Tutorial 11: Environmental Reflection Mapping 129 due to the color value of the material's Matte Color component: it is black and this leaves no room for shade gradation. The material's Matte Color provides the basis for which light and shading characteristics will interact. In order for any material to exhibit a reaction to light and shadow gradation, the Matte Color must have some value greater than 0. The optimum Matte Color for shading effects is pure white, or a value of 1, but at this level the reflect image component will not appear. If you remember in Tutorial 8, reflections appear best when the Matte Color is pure black, or value 0. Therefore, a balance must be struck between seeing the reflection and seeing light gradation.

Let's re-edit the material "dome" to change the Matte Color value. Open the Material Designer with the material "dome". Select . Set the Matte Color to HSV values 0, 0, 0.2. Save and confirm "Replace". Close the Material Designer. Select the button on the Command Bar to open the Render Toolbox.

This time, let's re-render all of the objects in the view.

Select the button on the Resource Manager to display the Object Resource Palette. Select the "Turn All On" option from the Objects pop-down above the Object Resource Palette. Select the button on the Render Toolbox. By manipulating the material's Matte Color value we are able to produce a more realistic chrome appearance. Now let's reflect the dome and goblet onto the tabletop.

Floor Reflect

Floor Reflect is used when reflections are needed on flat surfaces. The material for which the Floor Reflect map is calculated must exist only on a single plane. The material can be assigned over multiple polygons, but these polygons must exist on the same plane. If the material is assigned to polygons on more than one plane, the reflection map will not be calculated correctly. As we learned in Tutorial 10, polygons have a front side as defined by the polynormal, and when this is facing the camera, the polygon is rendered. The polynormal direction is extremely important when calculating a Floor Reflect because Renderize Live will use this normal direction to determine which direction to face when calculating a reflection map for a flat surface. Only those objects on the front side of the object are

130 Tutorial 11: Environmental Reflection Mapping included in the reflection. If the object's polynormal is reversed, the calculated Floor Reflect map will render in the wrong direction. The object "top", which represents the tabletop on which we want to define a Floor Reflect map, is currently mapped with the material "top". However, because this material is assigned to the edges and underside of the tabletop in addition to the top of it, we must modify the material assignment to isolate the top side of the tabletop. Choose the button on the Command Bar to open the Select Toolbox.

First we'll create a new material. In the type-in on the Material area of the Select Toolbox, enter the name "top2" and press the button. A new material named "top2" is created and is the current material in the Select Toolbox. Now we want to modify material assignments so that the top of the tabletop has its own unique material. We can do this in a number of ways: in this example we will assign the edges and underside to the new material "top2", so that the material "top" is assigned to the tabletop only.

The first thing we want to do is turn off the other objects in our view so that the tabletop is more accessible. Select on the Objects pop-down above the Resource Palette and choose the "Turn All Off" option. Now scroll down the Object Resource Palette until you find the object "top", then point to this object, hold down the right mouse button and choose the "On" option. The viewport will continue to display all objects until the next time it is updated.

We want to re-orient the tabletop to make it easier to select the desired polygons. Drag the object "top" and drop it into the Move Well.

We want to select backfacing polygons in addition to front facing ones, so we need to display them. Select the button on the Command Bar to display and select object backfaces. Now the viewport updates so that only the object "top" is displayed. Because the button is enabled on the Command Bar, all the polygons within or intersected by the bounding box, even those polygons that we don't see, are selected.

Now we'll rotate the tabletop.

Select the button on the Select Toolbox to display the Viewport Control commands. Select the button on the Viewport Control area of the Select Toolbox.

Tutorial 11: Environmental Reflection Mapping 131 Move the pointer into the viewport and drag it up to rotate the tabletop until you are looking at it edge-on. Remember that any changes to object orientation made in the Select or Normals Toolbox is only temporary: it does not affect the rendered view.

Now that we have re-oriented the object. let's pick polygons. Select the button on the mode area of the Select Toolbox to display the Polygon Selection commands. Make sure the and buttons are enabled in the Polygon Selection area of the Select Toolbox: this means that we are selecting polygons that are inside or clipped by the bounding box. Move the pointer into the viewport and drag a bounding box so that it intersects the entire lower edge of the table, and extends below the underside of the tabletop.

Figure 70. Draw a bounding box to select the edges and underside of the tabletop.

Press the button in the Change area of the Select Toolbox to apply our changes. The new material has been defined. Now the material "top" is assigned only to those polygons that make up the top surface of the tabletop; the new material "top2" is assigned to the edges and the underside of the tabletop.

Now we can calculate a Floor Reflect map for the material "top". But before we do so, we need to turn the other objects in the view back on: otherwise they won't be calculated in the rendering of the Floor Reflect map. Select the "Turn All On" option from the Objects pop-down above the Object Resource Palette.

132 Tutorial 11: Environmental Reflection Mapping Select the button on the Command Bar to display the Render Toolbox.

You cannot calculate environmental reflection maps while in the Select or Normals Toolboxes. Load the material "top" into the Material Designer. Before calculating the reflection map, let's assign the current material attributes to the new material "top2". Select in the material name type-in and change the name to "top2". Select "Save" and confirm "Replace". Now the edges and underside of the table will render with these material attributes.

Now let's generate the reflection for the top surface of the tabletop. Drag the material "top" and drop it into the Material Designer. Select the "Floor Reflect" Illumination Type. Select "Calculate". Set the Percent Reflect to 0.4. Select . Set the Matte Color value to HSV 0, 0, .70. Save the material and confirm "Replace". Close the Material Designer. Select the button on the Command Bar to open the Render Toolbox. Select the button on the Render Toolbox. Now the reflections appear as we desired. Floor Reflect maps can be very realistic, but the materials for which they are calculated can only exist on one plane.

Controlling the Resolution of Environmental Reflection Maps

Environmental reflection maps are rendered as square images based on the resolution set in the "X Res" type-in on the Render to File area of the Render Toolbox, multiplied by the "Test" setting on the Render to Screen area. For example, if "Test:1" is set in the Render Toolbox and the "X Res" is set to "640", then the reflection map will be calculated at 640x640 pixels. If the Test Render value were reset to 1/4, then the image would be calculated to one quarter the size: 160x160 pixels. The size at which you decide to render these reflection maps will depend on the amount of system resources (RAM and swap file) that you have to spare, and the size of the final rendering that you wish to create. Let's say that you create a scene in which a tabletop exists in the foreground of the view, taking up a significant amount of the viewport. Because a reflection map on this tabletop would be a prevalent element of the image, you would want it to be of the highest possible

Tutorial 11: Environmental Reflection Mapping 133 quality. Therefore you would want to generate the reflection map at the same resolution as that of the final rendering. For example, if you will be executing a final render at 2048 pixels, you would want to generate the reflection map at 2048 pixels also. You would do so by entering "2048" as the "X Res" on the Render Toolbox before calculating the reflection map. The scenario described above offers the highest possible quality with no expense spared. In the real world, however, you may not have enough system resources to achieve this kind of quality. This is not a critical problem. Even in the scenario above, where the reflection map is in the foreground of the image, you can render that reflection map to a lower (more affordable) resolution, and use the and options on the Render Toolbox to refine the reflection map during rendering to compensate for reflection maps that are less highly showcased, resolution is even less of an issue. Regardless of the size at which you wish to calculate your reflection map for the final output, it is highly recommended to calculate a low resolution reflection map (perhaps 320 pixels) initially, and use this map during the creation process, as this will reduce rendering time considerably. Then, when you are finished designing your view and ready to execute a final render, re-calculate the reflection maps at the higher resolutions desired for the final output.

Saving Environmental Reflection Maps

Environmental reflection maps act as any other image in Renderize Live. Just as with other images, they must be saved to disk so that they continue to exist when you return to this project at a later time. These images are not saved to disk at the time they are calculated. You must load these images into the Image Designer and use the File, Save command to save them to disk. Otherwise, when you save the project you will be warned that these images have not been saved and you will be asked if you wish to do so.

Limitations of Reflection Maps

Remember that the reflection maps generated by Renderize Live are "static". They will not automatically update when the camera is moved, or when an object has been added to the view, or a material has been redefined. Quite often, movement of the camera and objects, and refinement of materials is adjusted right up to the moment of the final render. Since reflections use all of these parameters, calculating these reflections should be the last refinements to a rendering, even after shadows have been set.

134 Tutorial 11: Environmental Reflection Mapping Using Reflection Maps During View Animation

Because reflection maps are static images, they may not update as the camera position changes during a view animation. If you wish to achieve complete accuracy for reflection maps during animation, you can do so, but at the cost of speed. First, for non-planer objects, you must use the Cubic Reflect reflection mapping type instead of the faster, and less accurate Spherical Reflect mapping type. When you use Cubic Reflect, the reflection will update correctly on the object as the camera position changes. If you have a Floor Reflect map in the animated view, this reflection map must be recalculated for each new camera position. This can be set to do so automatically by selection in the Animation Designer (animation is described in full in the following tutorial).

Tutorial 11: Environmental Reflection Mapping 135