Environmental Reflection Mapping
Total Page:16
File Type:pdf, Size:1020Kb
Tutorial 11: Environmental Reflection Mapping 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 shading 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 normal 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.