20 #if !defined(__MITSUBA_RENDER_BSDF_H_)
21 #define __MITSUBA_RENDER_BSDF_H_
118 inline void reverse();
121 std::string toString()
const;
232 EDiffuseReflection = 0x00002,
234 EDiffuseTransmission = 0x00004,
236 EGlossyReflection = 0x00008,
238 EGlossyTransmission = 0x00010,
240 EDeltaReflection = 0x00020,
242 EDeltaTransmission = 0x00040,
244 EDelta1DReflection = 0x00080,
246 EDelta1DTransmission = 0x00100,
252 EAnisotropic = 0x01000,
254 ESpatiallyVarying = 0x02000,
256 ENonSymmetric = 0x04000,
258 EFrontSide = 0x08000,
262 EUsesSampler = 0x20000
268 EReflection = EDiffuseReflection | EDeltaReflection
269 | EDelta1DReflection | EGlossyReflection,
271 ETransmission = EDiffuseTransmission | EDeltaTransmission
272 | EDelta1DTransmission | EGlossyTransmission | ENull,
274 EDiffuse = EDiffuseReflection | EDiffuseTransmission,
276 EGlossy = EGlossyReflection | EGlossyTransmission,
278 ESmooth = EDiffuse | EGlossy,
280 EDelta = ENull | EDeltaReflection | EDeltaTransmission,
282 EDelta1D = EDelta1DReflection | EDelta1DTransmission,
284 EAll = EDiffuse | EGlossy | EDelta | EDelta1D
289 return (
int) m_components.size();
298 return m_combinedType;
305 inline unsigned int getType(
int component)
const {
306 return m_components[component];
314 if (componentType & ESmooth) {
316 }
else if (componentType & EDelta) {
318 }
else if (componentType & EDelta1D) {
321 Log(
EError,
"getMeasure(): Invalid component type!");
328 return (type & m_combinedType) != 0;
333 return m_usesRayDifferentials;
398 const Point2 &sample)
const = 0;
451 virtual Float getEta()
const;
476 virtual void getFrameDerivative(
const Intersection &its,
520 const std::
string ¶mName,
Float max) const;
532 std::pair<
Texture *, Texture *> ensureEnergyConservation(
533 Texture *tex1, Texture *tex2, const std::
string ¶mName1,
534 const std::
string ¶mName2,
Float max) const;
539 std::vector<
unsigned int> m_components;
540 unsigned int m_combinedType;
541 bool m_usesRayDifferentials;
542 bool m_ensureEnergyConservation;
static EMeasure getMeasure(unsigned int componentType)
Return the measure corresponding to a particular component type.
Definition: bsdf.h:313
Stores a three-dimensional orthonormal coordinate frame.
Definition: frame.h:37
Generic serializable object, which supports construction from a Properties instance.
Definition: cobject.h:40
int getComponentCount() const
Return the number of components of this BSDF.
Definition: bsdf.h:288
Base class of all textures. Computes values for an arbitrary surface point. Texture2D is a specializa...
Definition: texture.h:34
Discrete measure.
Definition: common.h:66
Abstract hardware resource.
Definition: shader.h:39
Length measure.
Definition: common.h:62
This data structured contains all information that is required to sample or query a BSDF...
Definition: bsdf.h:40
Base class of all sample generators.
Definition: sampler.h:66
ETypeCombinations
Convenient combinations of flags from EBSDFType.
Definition: bsdf.h:266
unsigned int typeMask
Bit mask containing the requested BSDF component types that should be sampled/evaluated.
Definition: bsdf.h:172
virtual Spectrum getSpecularReflectance(const Intersection &its) const
Return the specular reflectance value (if any)
Definition: bsdf.h:340
EBSDFType
This list of flags is used to classify the different types of lobes that are implemented in a BSDF in...
Definition: bsdf.h:224
Vector wo
Normalized outgoing direction in local coordinates.
Definition: bsdf.h:151
const Intersection & its
Reference to the underlying surface interaction.
Definition: bsdf.h:124
virtual void serialize(Stream *stream, InstanceManager *manager) const
Serialize this object to a binary data stream.
EMeasure
A list of measures that are associated with various sampling methods in Mitsuba.
Definition: common.h:56
unsigned int sampledType
Stores the component type that was sampled by BSDF::sample()
Definition: bsdf.h:187
bool hasComponent(unsigned int type) const
Test whether this BSDF contains a certain type of component.
Definition: bsdf.h:327
bool usesRayDifferentials() const
Return whether this BSDF makes use of ray differentials.
Definition: bsdf.h:332
virtual void addChild(const std::string &name, ConfigurableObject *child)
Add a child (default implementation throws an error)
#define Log(level, fmt,...)
Write a Log message to the console (to be used within subclasses of Object)
Definition: logger.h:35
Sampler * sampler
Pointer to a Sampler instance (optional).
Definition: bsdf.h:135
Solid angle measure.
Definition: common.h:60
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
Float eta
Relative index of refraction in the sampled direction.
Definition: bsdf.h:154
int sampledComponent
Stores the component index that was sampled by BSDF::sample()
Definition: bsdf.h:192
virtual void configure()
Configure the object (called once after construction and addition of all child ConfigurableObject ins...
ETransportMode mode
Transported mode (radiance or importance)
Definition: bsdf.h:161
virtual void setParent(ConfigurableObject *parent)
Notify the ConfigurableObject instance about its parent object.
Abstract BSDF base-class.
Definition: bsdf.h:215
Error message, causes an exception to be thrown.
Definition: formatter.h:33
unsigned int getType(int component) const
Definition: bsdf.h:305
int component
Integer value specifying the requested BSDF component index that should be sampled/evaluated (for mul...
Definition: bsdf.h:181
void addChild(ConfigurableObject *child)
Add an unnamed child.
Definition: bsdf.h:490
unsigned int getType() const
Return a listing of this BSDF's component types and properties, combined using binary OR...
Definition: bsdf.h:297
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
Coordinates the serialization and unserialization of object graphs.
Definition: serialization.h:65
Discrete spectral power distribution based on a number of wavelength bins over the 360-830 nm range...
Definition: spectrum.h:663
Radiance transport.
Definition: common.h:38
Vector wi
Normalized incident direction in local coordinates.
Definition: bsdf.h:143
ETransportMode
Specifies the transport mode when sampling or evaluating a scattering function.
Definition: common.h:33