#include <core/LightShader.h>
Inheritance diagram for LightShader:

Public Member Functions | |
| virtual rgb | emittedRadiance (const HitRecord &rec, Context &context) const |
| virtual void | estimateRadiance (const HitRecord &rec, Context &context, Vector3 &w_in, double &distance, rgb &radiance) const |
| virtual rgb | estimateBGRadiance (const HitRecord &rec, const Vector3 &w_in, Context &context) const |
| virtual bool | sampleDirection (const HitRecord &rec, Context &context, Vector3 &w_in, double &pdf) const |
| virtual double | pdfDirection (const Vector3 &w_in, const HitRecord &rec, Context &context) const |
The LightShader class describes the emission of light. This applies to area lights, singular light shaders (point lights, directional lights, etc) and background light.
When sampling light sources, the returned value of the pdf must be equivalent to calling pdfDirection with the the same inputs and the generated direction. Otherwise the mismatch will cause an invalid result.
|
||||||||||||
|
Used for area lights. The area light's surface has been intersected, so the shader should return the emitted radiance at the hit point in the direction ray came from.
Reimplemented in DiffuseLightShader, and SpectralLight. |
|
||||||||||||||||||||||||
|
Estimate the radiance this light deposits towards a point in the scene. The light should not attempt an intersection with the scene to determine if an occlusion exists. Occlusion testing can be performed by the caller with the retured 'w_in' and 'distance'. Singular light sources, such as point lights, would only implement this function and allow the caller to test for occlusion. LightShaders intended for area lights may also implement this function as it may allow for importance sampling of luminaires based on estimated radiance.
Reimplemented in ConstantEnvironment, CylindricalEnvironment, and UberLight. |
|
||||||||||||||||
|
Estimate the radiance this light produces along the ray given by the input direction and the hit point in rec. This function is intended for background environments and should be called for rays that leave the scene without intersecting any geometry.
Reimplemented in ConstantEnvironment, and CylindricalEnvironment. |
|
||||||||||||||||||||
|
Attempt to generate a directional sample towards this light source.
Reimplemented in ConstantEnvironment, and CylindricalEnvironment. |
|
||||||||||||||||
|
Evaluate the pdf of generating the sampled direction.
Reimplemented in ConstantEnvironment, and CylindricalEnvironment. |
1.4.3