Textured Area Emitters (5 pts)
Implementation
Changed files:
arealight.cpp
Our previous implementation of area emitters only allowed to specify a single Color3f
value for the emitted radiance.
To create more interesting area emitters, this feature allows to specify a texture instead which specifies varying colors and intensity for
the radiance value.
As I have already implemented image textures, adding support for this feature only required a few small changes to the existing AreaEmitter
class. Namely, I had to add support for adding a child of type texture to the area emitter and adapt the eval
method so that it checks whether
a child of type texture is present, and if yes calls its eval
method with the uv coordinates, and otherwise uses the constant m_radiance
value as before. Note that as I need to access the uv coordinates in the emitter's eval
method, I had to add this field to the
EmitterQueryRecord
struct. To avoid having to change much of the code structure, I offloaded the handling of uv coordinates to the integrators,
meaning that they are responsible for setting lRec.uv both when calling eval
or sample
(for an example on how I did this, refer
to either the direct_mats or direct_ems integrator).
Note that I do not importance sample textured area emitters, as results did not suffer from much noise and in a QnA session it was confirmed that importance sampling is not required for this feature.
Validation
I validated my implementation by comparing with Mitsuba. For the test scenes, my renders closely matched Mitsuba (using the direct integrator with 256 spp). Interestingly, Mitsuba seems to assume that area emitters absorb all incoming light, whereas my renderer does not have this assumption. This difference is barely noticeable in the first image (only on the earth sphere where the area oriented towards the banana is slightly yellow tinted), whereas in the second scene it is clearly noticeable as I have added a strong area emitter at the ceiling.
Scene without extra ceiling area emitter (direct integrator, 256 spp)


Scene with extra ceiling area emitter (direct integrator, 256 spp)

