Points of Light

June 5th, 2007 by Vladimir Jankijevic - Viewed 18039 times -




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:

hex.gif

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.

ppg.gif

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).

You are welcome to send me bug-reports or suggestions.

FG Quicktime
GI Quicktime
Caustics Quicktime

types.gif

Buddha 3D-Model courtesy of the Stanford Computer Graphics Laboratory.

8 Responses to “Points of Light”

  1. Harry Bardak says:

    Now that we got a FGmap structure that give the idea to use it to store information I want such as occlusion. In another word a 3D bake a la renderman …..

    thanks vladimir.

  2. Steven Caron says:

    thanks for sharing vladimir!

    i am with harry on the brick mapping!

  3. irakli says:

    great tool, thanks. it will be great to have ability to hide/isolate some part of map. and i found a bug?- when i reset the scene map stays alive.
    cheers!

  4. 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.

  5. Anderson Bovell says:

    Thank you for this great tool i was really hoping soft would impliment something like this as i loved to use it in maya .

  6. Jasper says:

    Can you explain what this is useful for? How would you use it to optimize a render?

    Thanks,
    jasper

  7. Karl says:

    Hello, I was wondering how to decipher the Photon Map main file structure. I have downloaded UltraEdit but can not understand the structure. Please help.

    Thank you
    Karl

  8. Takashi says:

    Hi,
    Does anyone know if this tool works with Softimage 2013? I have not been successful…
    Thanks,
    -Takashi