Just a few years ago it took the power of a workstation to create the kind of images you will create in this chapter. Today you can render not just a single image but several hundred images to build computer animations. And with the explosion of game software the Internet and virtual reality real-time walk-through sessions of 3D computer models are nearly as commonplace as word processors.
In this chapter you’ll learn how you can use rendering tools in AutoCAD to produce rendered still images of your 3D models. With these tools you can add materials control lighting and even add landscaping and people to your models.You also have control over the reflectance and transparency of objects and you can add bitmap backgrounds to help set the mood.
Things to Do Before You Start
You will want to take certain steps before you start working with the rendering tools so you won’t run into problems later. First make sure you have a lot of free disk space on the drive where Windows is installed. Having 100 megabytes of free disk space will ensure that you won’t exceed your RAM capacity while rendering. This may sound like a lot but remember you are attempting to do with your desktop computer what only workstations were capable of a few years ago. Also make sure there is plenty of free disk space on the drive where your Auto- CAD files are kept.
Creating a Quick Study Rendering
Throughout this chapter you will work with a 3D model that was created using AutoCAD’s solid modeling tools (you’ll learn more about solid modeling in Chapter 18).The model is of two buildings on a street comer. You’ll start by creating a basic rendering using the default settings in the Render dialog box.
1. Open the Facade. dwg file from the companion CD-ROM.
2. Open the Render toolbar from the Toolbar dialog box
3. Choose View> Render >- Render or click the Render tool in the Render toolbar.
The Render dialog box appears. In time you will become intimately familiar with this dialog box .
4. Click the Render button. AutoCAD takes a minute or two to render the current view. While it’s working, you will see messages in the Command window showing you the progress of the rendering. When AutoCAD is done the model appears as a surface-shaded model (see Figure 17.1).
When you render a model without any special settings, you get what is called a Z buffer shaded model. The surfaces are shaded in their color and the light source is by default from the camera location. This view is much like a Hidden-Line view with color added to help distinguish surface orientation. You can actually get a similar view using the flat Shade tool on the Shade toolbar
Simulating the Sunlight Angle
The ability to add a sunlight source to a drawing is one of AutoCAD’s key features. This is a tool used frequently in the design of buildings in urban and suburban settings. Neighboring building owners will want to know if your project will cast darkening shadows over their homes or workplaces. The Sun option lets you accurately simulate the sun’s location in relation to a model and its surrounding
buildings. AutoCAD also lets you set up multiple light sources other than the sun.
So let’s add the sun to our model to give a better sense of the buildings form and relationship to its site.
1. Choose View> Render> Lights or click Lights on the Render toolbar.
Whenever you are creating a new light or other object with the Rendering tool you usually have to give It a name first. before you can do anything else.
2. In the Lights dialog box choose Distant Light from the drop-down list next to the New button toward the bottom left.
3. Click the New button. The New Distant Light dialog box appears
4. Type SUN in the Light Name input box toward the top of the dialog box. This dialog box lets you control various aspects of the light source such as color and location.
5. Because you want to simulate the sun in this example dick the button labeled Sun Angle Calculator The Sun Angle Calculator dialog box appears.
Notice that you have options for setting the date and time to determine the exact location of the sun. In addition you have the option to indicate where true polar north is in relation to your model. AutoCAD assumes polar north is at the 90° position in the WCS
6.One important factor for calculating the sun angle is finding your location on the earth: Click the Geographic Location button. The Geographic Location dialog box appears.
Here you can tell AutoCAD where your building is located in the world.
7. For the sake of this tutorial, suppose the Facade modsi is a building in San Francisco California USA. Select North America from the drop-down list above the map.
8. Locate and select San Francisco CA in the scrolling list to the left of the map. Notice that the Latitude and Longitude input boxes below the list change to reflect the location of San Francisco. For locations not listed you can enter values manually in those input boxes
9. Now click OK to return to the Sun Angle Calculator dialog box Set the Date for 9/21 and the time for 14:00 hours, Notice that the graphic to the right of the dialog box adjusts to show the altitude and azimuth angle of the sun for the time you enter.
10. Click OK in the Sun Angle Calculator dialog box and the I few Distant Light dialog box and then click OK again in the Lights dialog box
11. Choose View >Render > Render or click Render on the Render toolbar. Then click the Render button in the Render dialog box. Your model will be shaded to reflect the sun’s location (see Figure 17.2
There is nothing like adding shadows to a 3D rendering to give the model a sense of realism. AutoCAD offers three methods for casting shadows. The default method is called Volumetric Shadows. This method takes a considerable amount of time to render more complex scenes. When using AutoCAD’s Ray Trace option (described later in this chapter), shadows will be generated using the Ray Trace method. The third method called Shadow Map offers the best speed but requires some adjustment to get good results. Shadow Map offers a soft-edge shadow. While shadow J.’!lapsare generally less accurate than the other two methods the soft-edge option fers a level of realism not available in the other two methods.
In the following exercise you will use the Shadow Map method. It requires the most amount of adjustments and yields a faster rendering.
1. Choose View> Render )0. Lights, or click Lights on the Render toolbar.
2. In the Lights dialog box, make sure SUN is highlighted and then clickModify. The Modify Distant Light dialog box appears.
When Adding shadows remember that you must turn on the Shadow option for both the Render dialog box and for each light that is to cast a shadow.
3. Click the Shadow On check box, and then click the Shadow Options button. The Shadow Options dialog box appears.
4.In the Shadow Map Size input box select 512 from the drop-down list. This is the actual number of pixels used to create the shadow map.
5.Click the Shadow Bounding Objects button. The dialog box temporarily disappears to allow you to select objects from the screen. This option allows you to select the objects you want to cast shadows.
6. Select the entire Facade building. Don’t select any of the building next to it. When you are done press .J. The Shadow Options dialog box reappears.
7. Click OK to close the Shadow Options.dialog box and then click OK in the Modify Distant Light dialog box. It may take several seconds before the dialog box closes.
8. When you get to the Lights dialog box click OK to close it.
9. Click the Render button on the Render toolbar.
10. In the Render dialog box, click the Shadows check box, and then click the Render button. After a minute or two, the model appears rendered with shadows (see Figure 17.4).
Don’t panic if the shadows don’t appear correct. The Shadow Map method needs some adjustment before it will give the proper shadows. The default settings are appropriate for views of objects from a greater distance than our current view. The following exercise will show you what to do for c!OSl>-UPviews.
1. Open the Render dialog box again and then click the button labeled More Options. The Photo Real Pender Options dialog box appc.lts .
2. In the Depth Map Shadow Controls group change the Minimum Bias value from 2 to.1.
3. In the same group change the Maximum Bias value from 4 to .2.
4. Click OK to close the Photo Real Render Options dialog box and then click Render. Your next rendering will show more accurately drawn shadows (see Figure 17.5
The shadow still looks a bit rough: You can further refine the shadow’s aprearance by increasing the Shadow Map Size to greater than 512. This setting can be found-in the Shadow Options dialog box in step 4 of the exercise just before the last one. Figure 17.6 shows the same rendering with the Shadow Map Size set to 1024. As you increase the map size you also increase render time and the amount of RAM required to render the view. If you don’t have enough free disk space you may find that AutoCAD will refuse to render the model. You will then either have to free up some disk space or decrease the map size.
Notice that the shadow has a soft edge. Youcan control the softness of the shadow edge using the Shadow Options dialog box you saw in the exercise before the last one. The Shadow Softness input box and slide bar let you sharpen the shadow edge by decreasing the value or soften it by increasing the value. The soft shadow is especially effective for renderings of building interiors or scenes where you are simulating artificial light.