Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::BSDFSamplingRecord Struct Reference

This data structured contains all information that is required to sample or query a BSDF. More...

#include <mitsuba/render/bsdf.h>

Public Member Functions

 BSDFSamplingRecord (const Intersection &its, Sampler *sampler, ETransportMode mode=ERadiance)
 Given a surface interaction and an incident direction, construct a query record which can be used to sample an outgoing direction. More...
 
 BSDFSamplingRecord (const Intersection &its, const Vector &wo, ETransportMode mode=ERadiance)
 Given a surface interaction an an incident/exitant direction pair (wi, wo), create a query record to evaluate the BSDF or its sampling density. More...
 
 BSDFSamplingRecord (const Intersection &its, const Vector &wi, const Vector &wo, ETransportMode mode=ERadiance)
 Given a surface interaction an an incident/exitant direction pair (wi, wo), create a query record to evaluate the BSDF or its sampling density. More...
 
void reverse ()
 Reverse the direction of light transport in the record. More...
 
std::string toString () const
 Return a string representation. More...
 

Public Attributes

const Intersectionits
 Reference to the underlying surface interaction. More...
 
Samplersampler
 Pointer to a Sampler instance (optional). More...
 
Vector wi
 Normalized incident direction in local coordinates. More...
 
Vector wo
 Normalized outgoing direction in local coordinates. More...
 
Float eta
 Relative index of refraction in the sampled direction. More...
 
ETransportMode mode
 Transported mode (radiance or importance) More...
 
unsigned int typeMask
 Bit mask containing the requested BSDF component types that should be sampled/evaluated. More...
 
int component
 Integer value specifying the requested BSDF component index that should be sampled/evaluated (for multi-lobed BSDFs). More...
 
unsigned int sampledType
 Stores the component type that was sampled by BSDF::sample() More...
 
int sampledComponent
 Stores the component index that was sampled by BSDF::sample() More...
 

Detailed Description

This data structured contains all information that is required to sample or query a BSDF.

See Also
BSDF::f()
BSDF::sample()

Constructor & Destructor Documentation

mitsuba::BSDFSamplingRecord::BSDFSamplingRecord ( const Intersection its,
Sampler sampler,
ETransportMode  mode = ERadiance 
)
inlineexplicit

Given a surface interaction and an incident direction, construct a query record which can be used to sample an outgoing direction.

By default, all components will be sampled irregardless of what measure they live on. For convenience, this function uses the local incident direction vector contained in the supplied intersection record. The mode of transport is set to ERadiance – the mode fie

Parameters
itsAn reference to the underlying intersection record
samplerA source of (pseudo-) random numbers. Note that this sampler is only used when the scattering model for some reason needs more than the two unformly distributed numbers supplied in the BSDF::sample() methods
modeThe transported mode (ERadiance or EImportance)
mitsuba::BSDFSamplingRecord::BSDFSamplingRecord ( const Intersection its,
const Vector wo,
ETransportMode  mode = ERadiance 
)
inline

Given a surface interaction an an incident/exitant direction pair (wi, wo), create a query record to evaluate the BSDF or its sampling density.

For convenience, this function uses the local incident direction vector contained in the supplied intersection record.

Parameters
itsAn reference to the underlying intersection record
woAn outgoing direction in local coordinates. This should be a normalized direction vector that points away from the scattering event.
modeThe transported mode (ERadiance or EImportance)
mitsuba::BSDFSamplingRecord::BSDFSamplingRecord ( const Intersection its,
const Vector wi,
const Vector wo,
ETransportMode  mode = ERadiance 
)
inline

Given a surface interaction an an incident/exitant direction pair (wi, wo), create a query record to evaluate the BSDF or its sampling density.

Parameters
itsAn reference to the underlying intersection record
wiAn incident direction in local coordinates. This should be a normalized direction vector that points away from the scattering event.
woAn outgoing direction in local coordinates. This should be a normalized direction vector that points away from the scattering event.
modeThe transported mode (ERadiance or EImportance)

Member Function Documentation

void BSDFSamplingRecord::reverse ( )
inline

Reverse the direction of light transport in the record.

This function essentially swaps wi and wo and adjusts mode appropriately, so that non-symmetric scattering models can be queried in the reverse direction.

std::string mitsuba::BSDFSamplingRecord::toString ( ) const

Return a string representation.

Member Data Documentation

int mitsuba::BSDFSamplingRecord::component

Integer value specifying the requested BSDF component index that should be sampled/evaluated (for multi-lobed BSDFs).

After sampling has been performed, the component index is stored inside sampledComponent.

Float mitsuba::BSDFSamplingRecord::eta

Relative index of refraction in the sampled direction.

const Intersection& mitsuba::BSDFSamplingRecord::its

Reference to the underlying surface interaction.

ETransportMode mitsuba::BSDFSamplingRecord::mode

Transported mode (radiance or importance)

This information is required for rendering with non-reciprocal BSDFs such as transmission through a dielectric material

int mitsuba::BSDFSamplingRecord::sampledComponent

Stores the component index that was sampled by BSDF::sample()

unsigned int mitsuba::BSDFSamplingRecord::sampledType

Stores the component type that was sampled by BSDF::sample()

See Also
BSDF::EBSDFType
Sampler* mitsuba::BSDFSamplingRecord::sampler

Pointer to a Sampler instance (optional).

Some BSDF implementations can significantly improve the quality of their importance sampling routines when having access to extra random numbers. This attribute provides a means of providing this capability to the BSDF.

unsigned int mitsuba::BSDFSamplingRecord::typeMask

Bit mask containing the requested BSDF component types that should be sampled/evaluated.

Set to BSDF::EAll by default. After sampling has been performed, the component type is stored inside sampledType.

See Also
BSDF::EBSDFType
Vector mitsuba::BSDFSamplingRecord::wi

Normalized incident direction in local coordinates.

Mitsuba uses the convention that wi and wo point away from the scattering event

Vector mitsuba::BSDFSamplingRecord::wo

Normalized outgoing direction in local coordinates.

Mitsuba uses the convention that wi and wo point away from the scattering event


The documentation for this struct was generated from the following files: