20 #if !defined(__MITSUBA_RENDER_SCENE_H_)
21 #define __MITSUBA_RENDER_SCENE_H_
90 void initializeBidirectional();
111 int sceneResID,
int sensorResID,
int samplerResID);
127 int sceneResID,
int sensorResID,
int samplerResID);
141 int sceneResID,
int sensorResID,
int samplerResID);
188 return m_kdtree->rayIntersect(ray, its);
222 return m_kdtree->rayIntersect(ray, t, shape, n, uv);
242 return m_kdtree->rayIntersect(ray);
290 Spectrum evalTransmittance(
const Point &p1,
bool p1OnSurface,
292 int &interactions,
Sampler *sampler = NULL)
const;
363 bool rayIntersectAll(
const Ray &ray,
Float &t,
390 bool rayIntersectAll(
const Ray &ray)
const;
445 Spectrum evalTransmittanceAll(
const Point &p1,
bool p1OnSurface,
447 int &interactions,
Sampler *sampler = NULL)
const;
483 const Point2 &sample,
bool testVisibility =
true)
const;
514 const Point2 &sample,
bool testVisibility =
true)
const;
559 const Medium *medium,
int &interactions,
const Point2 &sample,
560 Sampler *sampler = NULL)
const;
607 const Medium *medium,
int &interactions,
const Point2 &sample,
608 Sampler *sampler = NULL)
const;
785 const Point2 &sample)
const;
813 const Point2 &sample,
const Point2 *extra = NULL)
const {
814 pRec.
object = m_sensor.get();
815 return m_sensor->samplePosition(pRec, sample, extra);
841 return m_sensor->pdfPosition(pRec);
887 const Point2 &spatialSample,
888 const Point2 &directionalSample,
911 return hasEnvironmentEmitter() ?
912 m_environmentEmitter->evalEnvironment(ray) :
Spectrum(0.0f);
924 if (!m_environmentEmitter)
926 Spectrum result = evalEnvironment(ray);
967 return m_aabb.getBSphere();
971 inline bool hasMedia()
const {
return !m_media.empty(); }
983 void setSensor(
Sensor *sensor);
986 void removeSensor(
Sensor *sensor);
989 void addSensor(
Sensor *sensor);
1080 inline std::vector<TriMesh *> &
getMeshes() {
return m_meshes; }
1082 inline const std::vector<TriMesh *> &
getMeshes()
const {
return m_meshes; }
1109 void setSourceFile(
const fs::path &name);
1113 void setDestinationFile(
const fs::path &name);
1116 inline bool destinationExists()
const {
return m_sensor->getFilm()->destinationExists(*m_destinationFile); }
1129 std::map<std::string, SerializableObject *> ¶ms);
1144 void addShape(
Shape *shape);
1160 std::vector<
TriMesh *> m_meshes;
1161 fs::path *m_sourceFile;
1162 fs::path *m_destinationFile;
1166 bool m_degenerateSensor;
1167 bool m_degenerateEmitters;
1172 #include <mitsuba/render/records.inl>
Record for solid-angle based area sampling techniques.
Definition: common.h:238
Abstract participating medium.
Definition: medium.h:103
const Film * getFilm() const
Return the scene's film.
Definition: scene.h:1067
const ConfigurableObject * object
Optional: Pointer to an associated object.
Definition: common.h:123
const ref_vector< ConfigurableObject > & getReferencedObjects() const
Return referenced objects (such as textures, BSDFs)
Definition: scene.h:1104
Three-dimensional normal data structure.
Definition: normal.h:39
bool rayIntersect(const Ray &ray, Float &t, ConstShapePtr &shape, Normal &n, Point2 &uv) const
Intersect a ray against all primitives stored in the scene and return the traveled distance and inter...
Definition: scene.h:220
Abstract triangle mesh base class.
Definition: trimesh.h:68
Abstract radiance emitter interface.
Definition: emitter.h:443
const fs::path & getSourceFile() const
Return the name of the file containing the original description of this scene.
Definition: scene.h:1107
Integrator * getIntegrator()
Return the scene's integrator.
Definition: scene.h:1034
Film * getFilm()
Return the scene's film.
Definition: scene.h:1065
uint32_t getBlockSize() const
Return the block resolution used to split images into parallel workloads.
Definition: scene.h:1121
Generic serializable object, which supports construction from a Properties instance.
Definition: cobject.h:40
Sensor * getSensor()
Return the scene's sensor.
Definition: scene.h:992
std::vector< TriMesh * > & getMeshes()
Return the scene's triangular meshes (a subset of getShapes())
Definition: scene.h:1080
bool hasDegenerateEmitters() const
Area all emitters in this scene degenerate? (i.e. they has collapsed to a point or line) ...
Definition: scene.h:962
const Integrator * getIntegrator() const
Return the scene's integrator (const version)
Definition: scene.h:1036
bool hasEnvironmentEmitter() const
Does the scene have a environment emitter?
Definition: scene.h:902
SAH KD-tree acceleration data structure for fast ray-triangle intersections.
Definition: skdtree.h:69
Generic sampling record for positions.
Definition: common.h:82
Simple reference-counted vector container based on std::vector and ref.
Definition: ref.h:144
const Emitter * getEnvironmentEmitter() const
Return the scene's environment emitter (if there is one)
Definition: scene.h:899
virtual void bindUsedResources(ParallelProcess *proc) const
Bind any used resources to the process proc.
Principal scene data structure.
Definition: scene.h:49
Render queue - used to keep track of a number of scenes that are simultaneously being rendered...
Definition: renderqueue.h:65
Abstract sensor interface.
Definition: sensor.h:66
Bounding sphere data structure in three dimensions.
Definition: bsphere.h:32
virtual Spectrum evalTransmittance(const Ray &ray, Sampler *sampler=NULL) const =0
Compute the transmittance along a ray segment.
Base class of all sample generators.
Definition: sampler.h:66
const ref_vector< Shape > & getSpecialShapes() const
Return a set of special shapes related to emitter/sensor geometry in bidirectional renderings...
Definition: scene.h:1091
void setSampler(Sampler *sampler)
Set the scene's sampler.
Definition: scene.h:1048
bool rayIntersect(const Ray &ray) const
Intersect a ray against all primitives stored in the scene and only determine whether or not there is...
Definition: scene.h:241
Abstract parallelizable task.
Definition: sched.h:197
Sampler * getSampler()
Return the scene's sampler.
Definition: scene.h:1060
void setIntegrator(Integrator *integrator)
Set the scene's integrator.
Definition: scene.h:1031
ref_vector< Emitter > & getEmitters()
Return the scene's emitters.
Definition: scene.h:1094
Abstract base class of all shapes.
Definition: shape.h:178
void addChild(ConfigurableObject *child)
Add an unnamed child.
Definition: scene.h:159
const ref_vector< Sensor > & getSensors() const
Return the list of sensors that are specified by the scene (const version)
Definition: scene.h:1019
ShapeKDTree * getKDTree()
Return the scene's kd-tree accelerator.
Definition: scene.h:1070
void setBlockSize(uint32_t size)
Set the block resolution used to split images into parallel workloads.
Definition: scene.h:1119
Spectrum evalEnvironment(const RayDifferential &ray) const
Return the environment radiance for a ray that did not intersect any of the scene objects...
Definition: scene.h:910
Ray differential – enhances the basic ray class with information about the rays of adjacent pixels on...
Definition: ray.h:140
ref_vector< Sensor > & getSensors()
Return the list of sensors that are specified by the scene.
Definition: scene.h:1007
const ref_vector< Emitter > & getEmitters() const
Return the scene's emitters.
Definition: scene.h:1096
bool hasMedia() const
Does the scene contain participating media?
Definition: scene.h:971
Axis-aligned bounding box data structure in three dimensions.
Definition: aabb.h:437
const AABB & getAABB() const
Return an axis-aligned bounding box containing the whole scene.
Definition: scene.h:940
ref_vector< ConfigurableObject > & getReferencedObjects()
Return referenced objects (such as textures, BSDFs)
Definition: scene.h:1102
virtual void addChild(const std::string &name, ConfigurableObject *child)
Add a child (default implementation throws an error)
const ref_vector< Shape > & getShapes() const
Return the scene's normal shapes (including triangular meshes)
Definition: scene.h:1086
Float pdfSensorPosition(const PositionSamplingRecord &pRec) const
Evaluate the spatial component of the sampling density implemented by the sampleSensorPosition() meth...
Definition: scene.h:840
Abstract seekable stream class.
Definition: stream.h:58
#define MTS_DECLARE_CLASS()
This macro must be used in the initial definition in classes that derive from Object.
Definition: class.h:158
const std::vector< TriMesh * > & getMeshes() const
Return the scene's triangular meshes (a subset of getShapes())
Definition: scene.h:1082
Abstract film base class - used to store samples generated by Integrator implementations.
Definition: film.h:37
virtual void configure()
Configure the object (called once after construction and addition of all child ConfigurableObject ins...
Reference counting helper.
Definition: ref.h:40
virtual void wakeup(ConfigurableObject *parent, std::map< std::string, SerializableObject * > ¶ms)
Retrieve any required resources.
virtual void serialize(Stream *stream, InstanceManager *manager) const
Serialize this object to a stream.
const ShapeKDTree * getKDTree() const
Return the scene's kd-tree accelerator.
Definition: scene.h:1072
const ref_vector< Medium > & getMedia() const
Return the scene's participating media.
Definition: scene.h:1100
Float pdfEmitterDiscrete(const Emitter *emitter) const
Return the discrete probability of choosing a certain emitter in sampleEmitter*
Definition: scene.h:848
Abstract interface for objects that reference shared network resources.
Definition: netobject.h:40
ref_vector< Shape > & getShapes()
Return the scene's normal shapes (including triangular meshes)
Definition: scene.h:1084
Abstract integrator base-class; does not make any assumptions on how radiance is computed.
Definition: integrator.h:49
Spectrum sampleSensorPosition(PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra=NULL) const
Sample a position on the main sensor of the scene.
Definition: scene.h:812
Coordinates the process of rendering a single image.
Definition: renderjob.h:37
Associative parameter map for constructing subclasses of ConfigurableObject.
Definition: properties.h:46
Container for all information related to a surface intersection.
Definition: shape.h:36
bool hasDegenerateSensor() const
Is the main scene sensor degenerate? (i.e. has it collapsed to a point or line)
Definition: scene.h:952
Spectrum evalAttenuatedEnvironment(const RayDifferential &ray, const Medium *medium, Sampler *sampler) const
Return the environment radiance for a ray that did not intersect any of the scene objects...
Definition: scene.h:922
Coordinates the serialization and unserialization of object graphs.
Definition: serialization.h:65
ref_vector< Medium > & getMedia()
Return the scene's participating media.
Definition: scene.h:1098
Discrete spectral power distribution based on a number of wavelength bins over the 360-830 nm range...
Definition: spectrum.h:663
virtual std::string toString() const
Return a human-readable string representation of the object's contents.
BSphere getBSphere() const
Return a bounding sphere containing the whole scene.
Definition: scene.h:965
ref_vector< Shape > & getSpecialShapes()
Return a set of special shapes related to emitter/sensor geometry in bidirectional renderings...
Definition: scene.h:1089
const Sensor * getSensor() const
Return the scene's sensor (const version)
Definition: scene.h:995
Abstract subsurface scattering models.
Definition: subsurface.h:38
Float getSamplingWeight() const
Return the luminaire's sampling weight.
Definition: emitter.h:535
const ref_vector< Subsurface > & getSubsurfaceIntegrators() const
Return the a list of all subsurface integrators.
Definition: scene.h:1077
const Sampler * getSampler() const
Return the scene's sampler.
Definition: scene.h:1062
bool rayIntersect(const Ray &ray, Intersection &its) const
Intersect a ray against all primitives stored in the scene and return detailed intersection informati...
Definition: scene.h:187
Discrete probability distribution.
Definition: pmf.h:35
const fs::path & getDestinationFile() const
Return the render output filename.
Definition: scene.h:1111
ref_vector< Subsurface > & getSubsurfaceIntegrators()
Return the a list of all subsurface integrators.
Definition: scene.h:1075
bool destinationExists() const
Does the destination file already exist?
Definition: scene.h:1116