Feature: Heterogeneous Volume

External libraries:
No further libraries than nori-framework has been used to complete this task.
Time spent:
6:00 (approximately)
  • Physically Based Rendering 2010
  • Lecture slides
  • include/nori/medium.h (new)
  • include/nori/phase.h (new)
  • include/nori/density.h (new)
  • src/medium.cpp (new)
  • src/phase.cpp (new)
  • src/density.cpp (new)
  • src/volume_path_simple.cpp (new)


Unfortunately I had to spend many hours for some other projects in other subjects as well I had quite a stressful time at work. Therefore I could not manage to really dive deep into the subject. However, I started already and hope to collect a few (very few) points for the hopefully correct entry.

I started the implementation with the book, but started to get confused between all these definitions. To be running out of time, it did not help much.


Medium (include/nori/medium.h, src/medium.cpp)

To store and render the volume-blocks in the scene, there needs to be a new class-type which represents the "EMedium"-type. Therefore I started with the medium-class . This is the base class to handle the heterogeneous and homogeneous volumes. I started with the homogeneous-class, which is implemented in the files with the said name.

Phase functions (include/nori/phase.h, src/phase.cpp)

The phase function is implemented in the Phase class and corresponds to the type "EPhase". This is an abstract class and the Henyey-Greenstein-function is implemented to use for the volumes.

Densities / Heterogeneous (include/nori/density.h, src/density.cpp)

To manage the heterogeneous-density-volumes, the density class is implemented. It is the interface for the different densities which are common. A few implementations are already implemented as usable classes.

Integrator (src/volume_path_simple.cpp)

In order to test the first steps into the implementation, I implemented a really simple integrator which is able to render a homogeneous volume. Currently, there is only one volume allowed per scene and it is queried for intersections by its own routine (simple one). This I would of course change and let the scene check all intersections in the same step, but give a feedback to the integrator weather it is a volume or a normal surface which has been hit.


I am pretty sure this is not as it should look like. But at least it is visible that the integrator itself is already interacting with the media.

First interaction