In the December 2011 issue of AUGIWorld, we discussed working with materials within AutoCAD® Architecture. Now it’s time to look at using those materials to render a drawing. First, what is rendering? In a nutshell, rendering creates a 2D image based on your 3D scene. It shades the scene's geometry by using the lighting you've set up, the materials you've applied and environmental settings such as fog and background.
The renderer in AutoCAD Architecture is a general-purpose renderer that generates physically correct simulations of lighting effects. A range of standard rendering presets are available. Some of the presets are tailored for relatively quick preview renderings while others are for higher quality renderings. While the final goal is to create a photorealistic, presentation-quality image that illustrates your vision, you may need to create many renderings before you reach that goal. At a basic level, you can use the Render command to render your model without applying any materials, adding lights, and so on. When you render a new model, the renderer automatically uses a virtual “over-the-shoulder” distant light. This light cannot be moved or adjusted.
Set the Render Destination
When you render a scene, the image can be displayed in either the viewport or the render window. This is called the render destination. The render destination is set in the Advanced Render Settings palette in the Render Context section (see Figure 1). The default setting is Window. To set the render destination, enter RPREF at the command prompt. This will open the Advanced Render Settings palette. Open the Destination list and select Window or Viewport. Render the scene.
When the render destination is set to Window, the renderer will automatically open the render window and the image is then processed. Upon completion, the image is displayed and a history entry is created. As more renderings occur, they are added to the render history so you can quickly look at previous images and compare to see which have the desired results. Images that you wish to keep can be saved from the Render Window.
If you choose to set the render destination to viewport, the generated image is rendered and displayed directly within the active viewport. This is basically a one-time rendering because there is no render history entry that you can compare with later images. If you want to keep the image you rendered to the viewport, the SAVEIMG command can be used to save the images. It is important to note that rendering to a viewport always renders against the background color you set for the drawing area.
Figure 1: Render destination
Rendering Views, Selected Objects, or Cropped Content
You can render an entire view, a set of selected objects, or a portion of what you see in the viewport (see Figure 2). Let’s look at each one.
The default is to render all objects in the current view in the drawing. If you haven’t opened a named view or camera view, the current view is rendered. While the rendering process is faster when you render key objects or smaller portions of a view, rendering the entire view lets you see how all objects are oriented to one another. Depending on the rendering destination you’ve chosen, the rendered view is displayed in the render window or directly in the viewport. To render a view, begin by displaying a 3D view of the model. Next, select the Render tab on the Render panel of the ribbon. Select Advanced Render Settings. Choose a render preset to control the quality and speed of the rendered output. Now, set the Destination to Window or Viewport to specify where you want the rendered image to be displayed. Render the scene.
If you’re adding detail to specific objects, you don’t want to waste time rendering an entire viewport. By changing the rendering procedure to Selected, you are prompted to pick the objects that you want rendered. Rendering a selection set of objects is very efficient when testing different materials, especially when the materials include texture mapping. By rendering a selected object, you can quickly verify how the material looks and if its texture coordinates must be altered. To render a selection of objects, select the Render tab on the Render panel of the Ribbon. Select Advanced Render Settings. Choose a render preset to control the quality and speed of the rendered output. Now, set the render procedure to Selected and select the objects in the model that you want to render. Render the scene.
Sometimes you need to render only a portion of what is displayed in the viewport, but you still want to see some of the surrounding environment. By setting the rendering procedure to Crop, you can specify a smaller region of the viewport to be rendered. Similar to selecting objects by window, you can set a rectangular region in the viewport. Any objects that appear in the region are rendered. Everything outside the region is ignored by the renderer. Note that a cropped rendering only displays in the viewport. To render a cropped view, enter RENDERCROP at the command prompt. Specify a window in the viewport that you want to render. Render the scene.
Figure 2: Rendering procedure
Set Output Resolution
You can set the resolution of the rendered image by specifying the width and the height of the image, in pixels. There are three resolution settings that control how a rendered image appears: the width, the height, and the image aspect ratio. The width and height settings control the size of the rendered image, measured in pixels. The default output resolution is 640 x 480 and can be set as high as 4,096 x 4,096. Higher resolution settings result in smaller pixels and finer detail. It is important to note, however, that high-resolution images take longer to render.
Output resolutions are set from the Output Size dialog box (see Figure 3). When you set an output resolution, it gets stored with the current drawing and is added to the output resolution list found in the Render panel of the ribbon. Most often, as you test how objects look in the model, you will find yourself using lower resolution settings, around 320 x 200 or lower. As you add more detail and materials, you’ll shift to mid-range settings, such as 640 x 480. The final rendering will always use the highest resolution required by the project, 1024 x 768 or greater, since this is the image that is presented to the customer or submitted for print.
Aspect ratio describes the proportions of a still image or the frames in an animation, expressed as the ratio of width to height, regardless of the image's resolution. The aspect ratio of an image is controlled by the Image Aspect setting. Aspect ratio is usually expressed either as a ratio of width over height (for example, 4:3) or as a multiplier (such as 1.333). Changing this value changes the height value to maintain the correct dimensions for the output resolution. If you choose to lock the image aspect, the width and height are tied together; changing one automatically changes the other while maintaining the aspect ratio.
Figure 3 – Output Size dialog box
Adding materials to objects greatly increases the realism of a model. In the context of rendering, materials describe how an object reflects or transmits light. Within a material, maps can simulate textures, bump effects, reflections, or refractions.
From the Advanced Render Settings palette, you can turn materials on or off, turn material filtering on or off, and affect how the surfaces of an object are rendered. Materials that you’ve created and attached to objects in the model are normally turned on when you start the rendering process. If you turn them off, all the objects in the model assume the characteristics of the GLOBAL material.
Using Lighting in Rendering
When there are no lights in a scene, the scene is shaded with default lighting. Default lighting is derived from two distant sources that follow the viewpoint as you move around the model. All faces in the model are illuminated so that they are visually discernible. You can control brightness and contrast, but you do not need to create or place lights yourself. When you insert custom lights or add sunlight, you can disable the default lighting. You can apply default lighting to the viewport only.
You add lights to give the scene a realistic appearance. Lighting enhances the clarity and three-dimensionality of a scene. You can create point lights, spotlights, and distant lights to achieve the effects you want (see Figure 4). You can move or rotate them with grip tools, turn them on and off, and change properties such as color and attenuation. The effects of changes are visible in the viewport in real time. Spotlights and point lights are each represented by a different light glyph. Distant lights and the sun are not represented by glyphs in the drawing because they do not have a discrete position and affect the entire scene. You can turn the display of light glyphs on or off while you work. By default, light glyphs are not plotted.
For more precise control over lighting, you can use photometric lights to illuminate your model. Photometric lights are physically correct lights that use photometric values, which enable you to define lights more accurately—as they would be in the real world. You can create lights with various distribution and color characteristics or import specific photometric files available from lighting manufacturers. Photometric lights can use manufacturers' IES standard file format. By using manufacturers’ lighting data, you can visualize commercially available lighting in your model. Then you can experiment with different fixtures and, by varying the light intensity and color temperature, you can design a lighting system that produces the results you want.
The sun is a special light similar to a distant light. The angle of the sun is defined by the geographic location that you specify for the model and by the date and time of day that you specify. You can change the intensity of the sun and the color of its light. The sun and sky are the primary sources of natural illumination. With the sun and sky simulation, you can adjust their properties. In the photometric workflow, the sun follows a more physically accurate lighting model in both the viewport and the rendered output. In the photometric workflow, you can also enable sky illumination, which adds soft, subtle lighting effects caused by the lighting interactions between the sun and the atmosphere.
Light fixtures can be represented by embedding photometric lights in blocks that also contain geometry. A luminary assembles a set of light objects into a light fixture.
Figure 4: Light types
Figure 5: Light adjustments
Using Shadows In Rendering
Shadows allow you to create rendered images that have greater depth and realism. The renderer can generate shadows by either shadow mapping or by ray tracing. Shadow-mapped shadows rely on a bitmap that the renderer generates during a pre-rendering pass of the scene. Shadow mapping provides softer edges and can require less calculation time than ray-traced shadows, but can be less accurate. Ray tracing traces the path of rays sampled from the light source. Shadows appear where rays have been blocked by objects. Ray-traced shadows have more accurate, hard edges, but do require more calculation time.
Shadow maps are the only way to generate soft-edged shadows; however, they do not show the color cast by transparent or translucent objects. Shadow-mapped shadows are calculated faster than ray-traced shadows. During a pre-rendering pass, a shadow map bitmap is created. Shadow quality can be controlled by increasing or decreasing the size of the shadow map. The default shadow map size is 256 x 256 pixels. If the shadow appears to be too grainy, increasing the map size will give you better quality. Shadow-mapped shadows should not be used if you have a light shining through a transparent surface.
To generate shadow-mapped shadows in a rendered image, begin by clicking the Render tab on the Render panel of the ribbon. Select Advanced Render Settings. In the Advanced Render Settings palette, make sure that Shadows is turned on. Now, select the shadow mode you wish to use. Turn on the shadow map and render the model.
Ray-traced shadows are generated by tracing the path of light beams or rays sampled from a light source. Ray-traced shadows are more accurate than shadow-mapped shadows. Ray-traced shadows have hard edges and accurate outlines. They also transmit color from transparent and translucent objects. Because ray-traced shadows are calculated without a map, you don't have to adjust resolution as you do for shadow-mapped shadows.
To generate ray-traced shadows in a rendered image, begin by clicking the Render tab on the Render panel of the ribbon. Select Advanced Render Settings. In the Advanced Render Settings palette, make sure Shadows is turned on. Select the shadow mode you want to use and then turn off Shadow Map. Render the model.
One of three shadow mode settings can be selected when shadows are turned on. The shadow mode can be set to Simple, Sort, or Segment (see Figure 7).
- Simple – The renderer calls shadow shaders in a random order. This is the default mode state for shadows.
- Sorted – The renderer calls shadow shaders in order, from the object to the light.
- Segment – The renderer calls shadow shaders in order along the light ray from the volume shaders to the segments of the light ray between the object and the light.
In order for shadows to be cast in a model, lighting must be established. A light source needs to be added to the scene and you need to specify if that light source will cast shadows. For shadows to display in the viewport as you set up the scene, you need to turn on shadows for the visual style. If you want shadows to appear in the rendered image, you need to turn on shadows and choose the type of shadows to render on the Advanced Render Settings palette.
Figure 6: Shadow options
Figure 7: Shadow mode settings
AutoCAD Architecture contains vast rendering possibilities. There are so many capabilities with the software that it’s difficult to learn everything quickly. I always say that the best way to learn something is to dive in and see what the software can do.
Melinda Heavrin is a CAD Coordinator & Facility Planner for Norton Healthcare in Louisville, Kentucky. She has been using AutoCAD Architecture since release 2000. Melinda can be reached for comments and questions at firstname.lastname@example.org.