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 are welcome to send me bug-reports or suggestions.
Buddha 3D-Model courtesy of the Stanford Computer Graphics Laboratory.