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

Container for all information related to a surface intersection. More...

#include <mitsuba/render/shape.h>

Public Member Functions

 Intersection ()
 
Vector toWorld (const Vector &v) const
 Convert a local shading-space vector into world space. More...
 
Vector toLocal (const Vector &v) const
 Convert a world-space vector into local shading coordinates. More...
 
bool isValid () const
 Is the current intersection valid? More...
 
bool isEmitter () const
 Is the intersected shape also a emitter? More...
 
bool isSensor () const
 Is the intersected shape also a sensor? More...
 
bool hasSubsurface () const
 Does the intersected shape have a subsurface integrator? More...
 
bool isMediumTransition () const
 Does the surface mark a transition between two media? More...
 
const MediumgetTargetMedium (const Vector &d) const
 Determine the target medium. More...
 
const MediumgetTargetMedium (Float cosTheta) const
 Determine the target medium based on the cosine of the angle between the geometric normal and a direction. More...
 
const BSDFgetBSDF (const RayDifferential &ray)
 Returns the BSDF of the intersected shape. More...
 
const BSDFgetBSDF () const
 Returns the BSDF of the intersected shape. More...
 
Spectrum Le (const Vector &d) const
 Returns radiance emitted into direction d. More...
 
Spectrum LoSub (const Scene *scene, Sampler *sampler, const Vector &d, int depth=0) const
 Returns radiance from a subsurface integrator emitted into direction d. More...
 
void computePartials (const RayDifferential &ray)
 Computes texture coordinate partials. More...
 
void adjustTime (Float time)
 Move the intersection forward or backward through time. More...
 
void getNormalDerivative (Vector &dndu, Vector &dndv, bool shadingFrame=true) const
 Calls the suitable implementation of Shape::getNormalDerivative() More...
 
std::string toString () const
 Return a string representation. More...
 

Public Attributes

const Shapeshape
 Pointer to the associated shape. More...
 
Float t
 Distance traveled along the ray. More...
 
Point p
 
Frame geoFrame
 Geometry frame. More...
 
Frame shFrame
 Shading frame. More...
 
Point2 uv
 UV surface coordinates. More...
 
Vector dpdu
 Position partials wrt. the UV parameterization. More...
 
Vector dpdv
 
Float dudx
 UV partials wrt. changes in screen-space. More...
 
Float dudy
 
Float dvdx
 
Float dvdy
 
Float time
 Time value associated with the intersection. More...
 
Spectrum color
 Interpolated vertex color. More...
 
Vector wi
 Incident direction in the local shading frame. More...
 
bool hasUVPartials: 1
 Have texture coordinate partials been computed. More...
 
uint32_t primIndex: 31
 Primitive index, e.g. the triangle ID (if applicable) More...
 
const Shapeinstance
 Stores a pointer to the parent instance, if applicable. More...
 

Detailed Description

Container for all information related to a surface intersection.

Constructor & Destructor Documentation

mitsuba::Intersection::Intersection ( )
inline

Member Function Documentation

void Intersection::adjustTime ( Float  time)
inline

Move the intersection forward or backward through time.

void mitsuba::Intersection::computePartials ( const RayDifferential ray)

Computes texture coordinate partials.

const BSDF * Intersection::getBSDF ( const RayDifferential ray)
inline

Returns the BSDF of the intersected shape.

The parameter ray must match the one used to create the intersection record. This function computes texture coordinate partials if this is required by the BSDF (e.g. for texture filtering).

Remarks
This function should only be called if there is a valid intersection!
const BSDF* mitsuba::Intersection::getBSDF ( ) const
inline

Returns the BSDF of the intersected shape.

void Intersection::getNormalDerivative ( Vector dndu,
Vector dndv,
bool  shadingFrame = true 
) const
inline

Calls the suitable implementation of Shape::getNormalDerivative()

const Medium* mitsuba::Intersection::getTargetMedium ( const Vector d) const
inline

Determine the target medium.

When isMediumTransition() = true, determine the medium that contains the ray (this->p, d)

const Medium* mitsuba::Intersection::getTargetMedium ( Float  cosTheta) const
inline

Determine the target medium based on the cosine of the angle between the geometric normal and a direction.

Returns the exterior medium when cosTheta > 0 and the interior medium when cosTheta <= 0.

bool Intersection::hasSubsurface ( ) const
inline

Does the intersected shape have a subsurface integrator?

bool Intersection::isEmitter ( ) const
inline

Is the intersected shape also a emitter?

bool Intersection::isMediumTransition ( ) const
inline

Does the surface mark a transition between two media?

bool Intersection::isSensor ( ) const
inline

Is the intersected shape also a sensor?

bool mitsuba::Intersection::isValid ( ) const
inline

Is the current intersection valid?

Spectrum Intersection::Le ( const Vector d) const
inline

Returns radiance emitted into direction d.

Remarks
This function should only be called if the intersected shape is actually an emitter.
Spectrum Intersection::LoSub ( const Scene scene,
Sampler sampler,
const Vector d,
int  depth = 0 
) const
inline

Returns radiance from a subsurface integrator emitted into direction d.

Remarks
Should only be called if the intersected shape is actually a subsurface integrator.
Vector mitsuba::Intersection::toLocal ( const Vector v) const
inline

Convert a world-space vector into local shading coordinates.

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

Return a string representation.

Vector mitsuba::Intersection::toWorld ( const Vector v) const
inline

Convert a local shading-space vector into world space.

Member Data Documentation

Spectrum mitsuba::Intersection::color

Interpolated vertex color.

Vector mitsuba::Intersection::dpdu

Position partials wrt. the UV parameterization.

Vector mitsuba::Intersection::dpdv
Float mitsuba::Intersection::dudx

UV partials wrt. changes in screen-space.

Float mitsuba::Intersection::dudy
Float mitsuba::Intersection::dvdx
Float mitsuba::Intersection::dvdy
Frame mitsuba::Intersection::geoFrame

Geometry frame.

bool mitsuba::Intersection::hasUVPartials

Have texture coordinate partials been computed.

const Shape* mitsuba::Intersection::instance

Stores a pointer to the parent instance, if applicable.

Point mitsuba::Intersection::p
uint32_t mitsuba::Intersection::primIndex

Primitive index, e.g. the triangle ID (if applicable)

const Shape* mitsuba::Intersection::shape

Pointer to the associated shape.

Frame mitsuba::Intersection::shFrame

Shading frame.

Float mitsuba::Intersection::t

Distance traveled along the ray.

Float mitsuba::Intersection::time

Time value associated with the intersection.

Point2 mitsuba::Intersection::uv

UV surface coordinates.

Vector mitsuba::Intersection::wi

Incident direction in the local shading frame.


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