Some time ago, I stumbled across the MapVIZ node in Maya and was surprised, that Softimage didn’t implement something like this in our beloved software package, XSI. Well, last weekend I decided to code it myself.

The first step to take, was to decipher the the file structure of the FG and Photon maps. Since the files are written in binary, this wasn’t that easy. But with the help of UltraEdit, a HEX editor for Windows, and some trial and error, the main file structure mystery was unveiled. Here is an example of how this looks like in a FG map:

The blue marked part is the file type and the version of MentalRay. The green part is a 32 bit integer value which is the total FG Point count. Next comes the FG Point itself. One FG point is represented in 104 bytes in total. That’s the first bright block. The first 12 bytes are the x, y and z coordinates in 32bit floating point numbers. And so on…

Final Gathering maps have another structure than Photon maps and thus it took me twice the time to build the file structure.

Once this was done, I had a little look into OpenGL programming and had a little talk to Andrea Interguglielmi. He helped me with the Logic behind the connection between XSI and OpenGL.

What this tool does is in fact pretty simple. When the plugin is loaded, it registers a new DisplayCallback and allocates some basic memory. Then, after you select a map and press on the “Show Map” button, it reads the chosen file and creates an array of position and color values which are stored in the memory and then displayed through some basic OpenGL functions.

With this tool you have the ability to view your saved FG and Photon maps in your 3D-Viewport of XSI. After installation, you can find it under Get-> Property-> JV_MapMiner. It is provided as is and nobody is responsible in any way for any possible damage.

I hope this tool can help people to optimize their renderings and make their lives a little bit more comfortable.

You can download the .xsiaddon (tested on XSI 5.x and 6.1) and a demo project with one FG map, one GI map, one Caustic map and one GI+Caustic map combined (27mb).

This entry was posted
on Tuesday, June 5th, 2007 at 9:56 pm and is filed under Plugins, Rendering, Tools.
You can follow any responses to this entry through the RSS 2.0 feed.
Both comments and pings are currently closed.

Thanks guys! Well, there should be a small update in the near future with some new features and if I have time I may include a hide function. The map stays alive because the array is generated when the plugin loads and is being deleted when you close xsi. You can clear the the screen with the button before you reset your scene.