Save point set to file support in MNGeoRecon

As requested by reader Jin, I added a small but probably useful feature to MNGeoRecon. From version 1.2 on it is possible to save the selected point set X^(k), i.e. the projected point set, to an .obj file of choice. The resulting file will first list point coordinates for each point and thereafter vertex normals for each point in the same order. Here’s an example:

# ----------------------------------------------------------------------
# MNGeoRecon iteration point export
#
# Created on Sat Aug 20 15:04:11 CEST 2011
# Total number of points: 500
#
# MNGeoRecon is available on http://www.maneumann.com
# ----------------------------------------------------------------------

v 0.48998146247597946 -0.18271761872019082 -0.0829339208557988
v 0.46302914269168144 -0.1443458936678494 -0.13340696642648717
v 0.39843450449279294 0.005884934692263533 -0.17219122412609567
...

# Estimated normals for each point
vn 0.059767976 0.908114 0.41443542
vn 0.1833163 0.7403643 0.6467271
vn 0.497972 -0.009690021 0.8671389

More information about the .obj file format can be obtained here.

  MNGeoRecon 1.2 (1.2 MiB, 616 hits) (Requires: Windows, Java, Java3D)

MNRT 1.00 Source Code and Documentation

Finally I can provide a link where you can download the source code for the initial release of MNRT (version 1.00). At first, I tried to place the code on Google Code, as I read a lot of its simplicity. However I got some server error during registration, which seemed to be related to the Mercurial revision control system. Consequently I wasn’t able to connect to the Mercurial repository.

However I did not want to give up the time I spent reading about Mercurial. So I tried another Mercurial-based code hosting provider, namely CodePlex, Microsoft’s counterpart to Google Code. Up to now I like this system very much. I only encountered problems uploading my huge project to the repository (using hg push <host>). They were related to my slow upload connection, as I got timeout errors.

The solution was to upload revision by revision using hg push -r <number> <host>. However I did not have more than one revision as I unfortunately developed MNRT without any revision control. So I created virtual revisions by adding the source files in chunks (core files, GUI files, …). I call them virtual, as they are not related to some development process.

The resulting repository at CodePlex can be found here:

MNRT project on CodePlex.

A comprehensive source code documentation created using Doxygen is available here:

MNRT source code documentation.

MNRT (Version 1.00)

Finally, with this post I want to release the application I developed during the creation of my Diplomarbeit (German master thesis equivalent):

GPU-basierte globale Beleuchtung mit CUDA in Echtzeit
Neumann, Mathias
Diplomarbeit, FernUniversität in Hagen, 2010

The application is called MNRT and implements several techniques to realize fast global illumination for dynamic scenes on Graphics Processing Units (GPUs). I referenced it in several previous posts, see e.g. here or here. Please check the

Documentation of MNRT

for more details.

Currently I only provide a download link for the compiled version of MNRT (see below). However, full source code including source code documentation will be released soon, when organisational problems are eliminated.

Read More »

Illumination cuts and results

In the meantime I was able to add the last final gathering acceleration technique of Wang et al. to my implementation. It is called illumination cuts and computes a cut through the kd-tree of the given photon map within which we want to gather. Here a cut defines the node set that contains exactly one node of each path from the tree root to any leaf of the tree. Subsequently we estimate the irradiance for each cut node.

To perform the final gather step we are now able to use the reduced set of cut nodes to interpolate irradiance values. So instead of searching within all photons of the photon map (usually several 100k), we just have to look for the closest cut nodes (some 1k).

Currently obtained computation times for a scene with the dragon model from the Stanford 3D Scanning Repository with approx. 202k triangles are listed in the following table.

Technique Time / s Speedup
Full final gathering 168.4 N/A
Illumination cut (17k) 13.8 12.2
Adapt. sample seeding (4k) + illum. cut (17k) 2.3 73.2

Without acceleration techniques of Wang et al. the GPU-based generation of one image takes about 168.4 s using my current implementation. I reach 35-45 MRays/s for primary rays and approx. 20 MRays/s for final gather rays. For all subsequent images I used 64 shadow rays (area light source) and 256 final gather rays per sample.

MNSimpleDragon scene, full final gathering with 256 samples

Read More »

Caustics Photon Map

While working on my thesis I added the treatment of caustics to my CUDA-application. A caustic results from light that undergoes specular reflexion/transmission at a curved surface. Scattered light rays travel in different directions and create interesting patterns at nearby surfaces.

To handle caustics, I added another photon map for photons that were scattered using specular reflection or specular transmission only. This is the caustics photon map. The other photon map, the global photon map, stores all other photons that hit a nonspecular surface (surface that can scatter light in a nonspecular way). On the one hand these are the direct photons which hit some surface right after emission from a light source. On the other hand these are indirect photons that underwent nonspecular scattering at least once.

I used Blender to construct some simple test scene for my implementation. It contains an orange, reflective sphere and a green, transmissive sphere with refraction index of 1.7. The smooth shadows are the result of an area light source. Bump-mapping is used to improve the quality of the brick walls.

MNCaustics scene

Read More »