19 #if !defined(__NORI_EMITTER_H)
20 #define __NORI_EMITTER_H
22 #include <nori/object.h>
57 wi = (
p -
ref).normalized();
107 throw NoriException(
"Emitter::samplePhoton(): not implemented!");
Superclass of all emitters.
Shape * m_shape
Pointer to the shape if the emitter is attached to a shape.
virtual EClassType getClassType() const override
Return the type of object (i.e. Mesh/Emitter/etc.) provided by this instance.
virtual Color3f eval(const EmitterQueryRecord &lRec) const =0
Evaluate the emitter.
virtual Color3f sample(EmitterQueryRecord &lRec, const Point2f &sample) const =0
Sample the emitter and return the importance weight (i.e. the value of the Emitter divided by the pro...
void setShape(Shape *shape)
Set the shape if the emitter is attached to a shape.
virtual ~Emitter()
Virtual destructor.
virtual Color3f samplePhoton(Ray3f &ray, const Point2f &sample1, const Point2f &sample2) const
Sample a photon.
virtual float pdf(const EmitterQueryRecord &lRec) const =0
Compute the probability of sampling lRec.p.
Simple exception class, which stores a human-readable error description.
Base class of all objects.
Superclass of all shapes.
Represents a linear RGB color value.
Data record for conveniently querying and sampling the direct illumination technique implemented by a...
EmitterQueryRecord(const Point3f &ref, const Point3f &p, const Normal3f &n)
Create a query record that can be used to query the sampling density after having intersected an area...
Normal3f n
Normal at the emitter point.
EmitterQueryRecord()
Create an unitialized query record.
Vector3f wi
Direction between the hit point and the emitter point.
Point3f ref
Origin point from which we sample the emitter.
Ray3f shadowRay
Shadow ray.
Point3f p
Sampled point on the emitter.
EmitterQueryRecord(const Point3f &ref)
Create a new query record that can be used to sample a emitter.
Intersection data structure.
3-dimensional surface normal representation