Lighting Simulation with Radiance
Radiance comes with a utility called rad that works like UNIX make. The input file to rad has a series of variables that tell it how you want to render a scene, and it figures out how to call the many other programs used to simulate the light. A commented sample is shown in Listing 6.
Most of the variables that take filenames can be defined as many times as there are files that apply. The view variable also can be defined many times. Each view definition causes the generation of a picture. You should include a name for the view, where you want to put your eyeball (-vp viewpoint), what direction you want to look (-vd view direction vector) and which way is up (-vu view up vector). I also like the -vt option for generating angular (fish-eye) views.
Using the H value with the various quality settings can take a long time (more than ten hours on 2GHz machines). Most times, the H setting is overkill, and M works fine. Use L for interactive rendering. The documentation and a little experimentation will help you figure out what is best for your scene.
To view a scene interactively, use the command:
$ rad -o x11 cabin.rif
The scene may appear bright and washed out when interactively viewing. Type e, press Enter, then click on a bright spot in the image to fix the exposure. You don't have to wait for the render to finish.
You can experiment with the exposure as much as you want. The dynamic range of Radiance image data far exceeds the dynamic range of your monitor. This means you can end up with a completely dark or completely white image that can be adjusted to your display without loss of data. This is drastically different from normal image files where adjusting the brightness too far can cause permanent loss of information.
You can load an alternate view from the rif file while interactively rendering with the L command. For example, if you have a view named interior in your rif file, typing L interior loads it. You can input a view manually by typing v and pressing Enter. Simply answer the prompts. Type q and press Enter to quit the interactive renderer.
To generate images of all of your views use:
$ rad cabin.rif
Then view the images with:
$ ximage *.picYou can adjust the exposure of an image in ximage by clicking on the image and pressing A for auto-exposure, H for human eye response or = to adjust based on the pixel you clicked.
Figures 5 and 6 show two completed daylight simulations of our cabin.
You can take light readings averaged over an area from ximage. Simply drag out a box and press L for luminance or Enter for radiance values. For a quick physics tutorial of the meaning of these numbers, see www.intl-light.com/handbook/rad.html. Press Q to quit an image.
I've covered a very small part of Radiance in this article due to space limitations. If you want to further populate your scenes with the clutter of daily life, be sure to check out the links from the Radiance web site for furniture and plants.
Anthony W. Kay is a computer programming consultant in Eugene, Oregon. When he's not simulating trees as building materials he goes hiking among the live ones.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
|Working with Command Arguments||May 28, 2016|
|Secure Desktops with Qubes: Installation||May 28, 2016|
|CentOS 6.8 Released||May 27, 2016|
|Secure Desktops with Qubes: Introduction||May 27, 2016|
|Chris Birchall's Re-Engineering Legacy Software (Manning Publications)||May 26, 2016|
|ServersCheck's Thermal Imaging Camera Sensor||May 25, 2016|
- Secure Desktops with Qubes: Introduction
- Secure Desktops with Qubes: Installation
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Working with Command Arguments
- CentOS 6.8 Released
- The Italian Army Switches to LibreOffice
- Linux Mint 18
- ServersCheck's Thermal Imaging Camera Sensor
- Chris Birchall's Re-Engineering Legacy Software (Manning Publications)
- Petros Koutoupis' RapidDisk
Until recently, IBM’s Power Platform was looked upon as being the system that hosted IBM’s flavor of UNIX and proprietary operating system called IBM i. These servers often are found in medium-size businesses running ERP, CRM and financials for on-premise customers. By enabling the Power platform to run the Linux OS, IBM now has positioned Power to be the platform of choice for those already running Linux that are facing scalability issues, especially customers looking at analytics, big data or cloud computing.
￼Running Linux on IBM’s Power hardware offers some obvious benefits, including improved processing speed and memory bandwidth, inherent security, and simpler deployment and management. But if you look beyond the impressive architecture, you’ll also find an open ecosystem that has given rise to a strong, innovative community, as well as an inventory of system and network management applications that really help leverage the benefits offered by running Linux on Power.Get the Guide