This plugin is an HDRShop-compatible executable by Jonathan Cohen, original concept by Paul Debevec, at the USC Institute for Creative Technologies for generating a set of directional light sources to approximate a lightprobe image. This is useful because it allows you to use image-based lighting with standard non-global illumination renderers.
First, you must have HDRShop, which is free for non-commerical and academic use and is
available here. To install the plugin,
download it from the bottom of the page. Create a directory on your system called "plugins"
which is in the same directory as the HDRShop executable, HDRShop.exe. Copy the file
"lightgen_plugin.exe" into this directory. When you start HDRShop, the option "lightgen_plugin"
should appear in the "Plugins" menu.
The plugin operates on a lightprobe image that is in latitude-longitude format, which is the
format of the lightprobe shown above. To convert a lightprobe into this format, load the
lightprobe into HDRShop. Then select "Image->Panorama->Panoramic Transformations" from
the main menu. This will pop up the panoramic transformations dialog box. Select the
lightprobe image as the "Source Image" and select which format it is in (for example,
if it is a high-dynamic range image of a mirrored ball, select "Mirror Ball"). In the
destination section, select "Latitude/Longitude" from the list box, and select a destination
resolution of 128 x 64. Higher resolution is not needed, and it merely slows down the light
generation algorithm. Finally, hit "Ok" to perform the conversion.
A new image in latitude/longitude format should now be displayed. You might want to center
it and zoom in (press '5' on the number pad to center it, and '[CTRL]+' to zoom in.) Select
"lightgen_plugin" from the "Plugin" menu. This will pop up the plugin dialog box. The plugin
takes the following options:
Output filename
Output file type
Number of lightsources
Max number of iterations
Number of searches
Scale total light intensity
Desired total light intensity
Once the options are selected, hit "Execute" to run the plugin. There is a bug in HDRShop where if the plugin takes a while to execute, HDRShop will think it has died and will report a failure. However, even if HDRShop reports a failure, the plugin is running just fine so you can ignore this warning. The output can be fed to standard modeling programs as follows:
Text
Arnold
Maya
Houdini
Radiance
LightWave 3D
if you don't set the "Scale total light output" option, the values of the lightsources may be very bright. This is because the total light output from the scene is equal to the sum of all the pixel values in the lightprobe image, which is usually pretty high. This is why, for example, the Houdini version creates a variable called lightgen_dimmer to make it easier to scale down the lightsource intensities. In Maya, you'd have to scale all the lights by hand.
The executable may be downloaded
here. It is provided free for academic and non-commercial use although
full copyright is maintained by the University of Southern California.
If you want a new file format, be sure to send me a template for the file that the
plugin should generate.
For feedback or requests, send us an email.
LightGen.exe
Thanks Tim Hawkins for helpful discussions and Craig Halperin, Marcos Fajardo, and Brian Emerson for help with testing. And thanks to Chris Tchou for writing the awesome HDRShop.