Wednesday, February 16, 2011

Underwater Scenes Illumination : Important Resources

Photon Mapping with participating media
Jensen's 1998 paper talks for the first time
Practical guide to global illumination using photon maps is brilliant to understand
I found a code for photon mapping with participating media here.

  • This page describes a course project on realistic underwater lighting using photon mapping by Stanford students. Has a source code and sample scene too.
  • This page by Mark Kilgard, talks about OpenGL-rendering of underwater caustics.

[EDIT: March 16, 2011]

[1]The FAQ for photon mapping implementation here and here are excellent.
[2]This source-code for photon mapping is a complete package. (including ray tracing pass).
[3]This source code is Jensen's photon mapping code. (with some little tweaks).
[4]This tutorial on photon mapping by Zack Waters is also excellent and is in the must-refer-to list.


Downloadable and compilable ray tracing implementations available on the Internet
  • Simple Ray tracer (uses Windows-specific headers; doesn't use acceleration structure; fast)
  • RayTrace 3.3 (both platforms; organized code; uses kd-tree; supports .obj and .nff scenes (arbit scenes don't work))
  • raytracer7 (really fast, uses kd-tree)
  • ultimate ray tracer (haven't tried)
  • heatRay (brilliant screenshots; haven't run the code yet)

3D Models Downloads available over the Web

[This list will be updated repeatedly.]

Wednesday, February 2, 2011

Photon Mapping

Important Resources I am using to right now

1) Jensen's Book ("Realistic Image Synthesis Using Photon Mapping")
- He, basically, invented photon mapping.
- Noticeably, The forward of the book (by Pat Hanrahan) cleverly clarifies the big picture about -radiosity, monte carlo ray tracing, and photon mapping and how are they co-related.
- The book also includes a photon mapping implementation.
- The first edition of the book had some errors, corrections to which are described here.

2) The Basic Monte Carlo Integration Technique
- The appendix A of Jensen's book has an excellent description of basic Monte Carlo integration.
- I couldn't find a better description of variance and standard deviation than this one.

3) Ray Tracing and photon mapping implementation here. It is based on this paper. The source code is a little weird ;-) I couldn't make it work in first 10 minutes, So I left it.

What am I planning to do with Photon mapping?

I shortlisted GPU photon mapping, volume rendering (participating media) as something that I would like to do with photon mapping. It turned out that it's going to be somewhat volume rendering, precisely, underwater illumination. I will be maintaining a separate post dedicated to the important resources that talk about underwater illumination ( with photon mapping or even with other techniques, for reference).

A few quick must-know-answer types questions:

1) Photon mapping's light transport notation?

Photon Map Creation Phase : L(S|D)*D
Photon Gathering/ Ray Tracing Phase : LS*E | DS*E

2) Is real time photon mapping possible today? Whats the fastest FPS for fairly complex scenes (remember- one of the motivations of saying NO to radiosity and YES to photon mapping is complex scenes; And one of the motivations of saying NO to Monte Carlo and YES to photon mapping is performance). Get the fastest FPS numbers for both CPU and GPU implementations.

4) On the same lines, photon mapping on GPU--Whats the state of the art?

5) Seems like some people prefer photon mapping, mainly because of caustics. If you try to think why radiosity won't give you caustics, then you would see that caustics involves specular objects, which radiosity is useless for. So, thats fairly straightforward for radiosity.
But, Why Monte Carlo ray tracing would not give you good caustics?
A phd dissertation helped me answer this question to a good degree. It says - "A major drawback of backward raytracing is the inability to adequately handle caustics. These are highly directional global illumination components which occur through specular reflections onto diffuse surfaces. They are often noticeable as iridescent highlights on otherwise dull materials from nearby specular objects. Since a backward raytracer traces rays from the observer toward the light sources it cannot predict the occurrence of caustics, as this would imply knowledge of which paths contribute to the caustic and ultimately reach the light source. Without such knowledge, rendering caustics with a backward raytracer borders on an exercise in futility, as the chances of finding paths which contribute to a caustic are miniscule.(sic)"
The dissertation also provides a few visuals to clarify the point. I found those pictures necessary to understand the point completely. Following visual from the same may help

Tuesday, February 1, 2011

Progress II

Finally after spending a few more hours on which parallel radix sort algorithm to implement, I have finally come to the conclusion that I am going to implement Partitioned Parallel Radix Sort. I have gone through the algorithm and started with some basic implementation.
One issue might have to be faced later that the paper is meant for distributed memory architectures whereas openMP is meant for shared memory architectures.

Interesting Readings:
Histogram Sort : To find the size of the buckets before-hand so that we wont waste space by overestimating the bucket size.
This might give you a better idea of what these sorting people mean by a Histogram !