Directional Light

Effect of the Feature

The directional light/emitter emits light in a single direction, with the assumption that the emitting source is infinitely far away and thus the emitted light comes from a single direction and has a constant intensity. This means, that it does not matter where an object is located in the scene, unless another object casts a shadow.

High Res - Directional Light

Technical Implementation

For the directional light, we created a new class directionallight.cpp that contains the whole logic. The interface of the class allows to provide a direction in which the light is shining using a simple Vector3f. This direction is automatically normalized. Aditionally, we can define the radiance which is emitted from the object. This makes more sense than power (like we did for the point light) in this scenario, as the power of the directional lightsource is in principal infinite.

Validation

We compare the directional light to the same functionality in PBRT-v3 (there called distant light). For validation, we use again a simple test scene and change both the light direction and the emitted radiance for comparison with PBRT.

  • Nori: cg-project-2022/nori/verification/directional/cbox_path_mis_directional.xml
  • PBRT: cg-project-2022/nori/verification/directional/directional.pbrt

Comparison 1 - Default Settings

  • Intensity: (15,15,15)
  • Direction: (1,1,1)
PBRT Mine (Nori)

Comparison 2 - Non-Uniform/Tinted Intensity

  • Intensity: (15,5,5)
  • Direction: (1,1,1)
PBRT Mine (Nori)

Comparison 3 - Changed Dirction

  • Intensity: (15,5,5)
  • Direction: (1,2,1)
PBRT Mine (Nori)

Conclusion: All renders are matching closely which we see as validation of the feature. For the tinted case, our version has a slightly higher saturation. It does not affect the render negatively however. It is also important to point out, that there is generally a bit less noise in the PBRT-renders which is likely caused by the minimal path depth when performing russian roulette.

Code Coordinates

The feature is purely implemented in the file src/directionallight.cpp It does identify itself as a delta light using the isDeltaLight() function of the emitter interface.