|HDR Lighting in Maya using HDR Shop, and the LightGen Plugin: |
The barebones approach to quickly get started with HDR lighting
Software: HDR Shop
Author: Adam Levine
Author Website: http://soundslikeblue.com/
First thing's first, you'll need to download a free copy of HDR Shop from Paul Debevec's HDR Shop page. (Click on Download v1) You'll also need the "LightGen" Plugin found under the Plugins section of his website.
Create a directory on your computer called "plugins" in the same directory as HDRShop.exe. Copy the file "lightgen_plugin.exe" that you just downloaded, into this directory. When you start HDR Shop, the option "lightgen_plugin" should appear in the "Plugins" menu.
You can create your own image to use as an HDR light probe or use one of the free maps on Paul Debevec's site. If you download one of his, make sure to download a .hdr file.
Now load the lightprobe into HDR Shop
Then select Image>Panorama>Panoramic Transformations from the main menu.
Select the lightprobe image as the Source Image and select which format it is in (if you are using an image of a mirror ball then select "Mirror Ball"). In the destination section on the right, select "Latitude/Longitude" and select a resolution of 128 x 64. Higher resolution isn't neccesary and it only slows down the light generation process. Hit ok to perform the conversion.
A new image in latitude/longitude format will now be displayed.
Select "lightgen_plugin" from the "Plugin" menu. This will pop up the plugin dialog box.
Make sure to name your file and select MEL as your Output file type. The number of lightsources to generate can be less or more than 20 but 20 produces good results. The more lights you choose, the longer your render time will ultimatley be. The Max iterations can stay at 100 and the number of searches can stay at the default "5". ALWAYS REMEMBER to check the box marked "Scale total light output". Otherwise your scene will be completley overblown! This is because by default, LightGen will generate lights that are very bright and since it adds up the total intensities of the pixels in the lightprobe image, the combined result will be much too bright.
Once the options are selected, hit "Execute" to run the plugin. There is a glitch in HDR Shop where if the plugin takes a while to execute, HDR Shop will think it has died and will report a failure. However, even if HDR Shop reports a failure, the plugin is running just fine so you can ignore the warning
After the computation is complete, open the newly created file with Notepad. (You'll have to do an "open file with" and choose Notepad.) Now copy all of the information in the Notepad and paste it into Maya's Script Editor.
Now hit Enter on the number pad. This will tell Maya to create 20 lights at different intensities.
A Locator is also created called "lightgen_control" with an attribute named "dimmer." The intensities of the lights are controled by the dimmer attribute. (Going above 1 can sometimes cause lights to become too "hot.") This should allow you to have more flexability with your scene.
Here is a render of a simple scene consisting of a Poly Sphere and a Poly Cube. This render was created by hitting "Render Scene."
Not too thrilling eh?
Now I'll add the script from the LightGen that I created earlier plus I'll make one of the lights cast Depth Map Shadows.
Pretty dark huh.
If you're looking for even more flexability and control, I suggest playing with making a 3 or more point light source in addition to your LightGen lights. You can play with making some of these shadow casting as well to add to a more realistic effect. Here is my new result. (HDR + 4 point lights at 1.0, 0.4, 0.2, and 0.05)
Sure, this may not be the most dynamic image ever created but it certainly opens the door to other possibilities for rendering options! I hope this tutorial was helpful! For more information be sure to check out Paul Debevec's site. This is where it all began.
Here is a copy of the scene file that I used for this tutorial. HDR lights, point lights, and geometry. HDR_tutorial_scene