An interface for generalized BSDF. More...
#include <generalizedbsdf.h>
Public Member Functions | |
LM_INTERFACE_CLASS (GeneralizedBSDF, Asset, 4) | |
LM_DISABLE_COPY_AND_MOVE (GeneralizedBSDF) | |
LM_INTERFACE_F (0, Type, int()) | |
Generalized BSDF type. More... | |
LM_INTERFACE_F (1, SampleDirection, void(const Vec2 &u, Float uComp, int queryType, const SurfaceGeometry &geom, const Vec3 &wi, Vec3 &wo)) | |
Sample outgoing vector. More... | |
LM_INTERFACE_F (2, EvaluateDirectionPDF, Float(const SurfaceGeometry &geom, int queryType, const Vec3 &wi, const Vec3 &wo, bool evalDelta)) | |
Evaluate PDF with the direction. More... | |
LM_INTERFACE_F (3, EvaluateDirection, SPD(const SurfaceGeometry &geom, int types, const Vec3 &wi, const Vec3 &wo, TransportDirection transDir, bool evalDelta)) | |
Evaluate generalized BSDF. More... | |
Public Member Functions inherited from Asset | |
LM_INTERFACE_CLASS (Asset, Clonable, 2) | |
LM_DISABLE_COPY_AND_MOVE (Asset) | |
LM_INTERFACE_F (0, Load, bool(const PropertyNode *prop, Assets *assets, const Primitive *primitive)) | |
Load an asset from a property node. More... | |
LM_INTERFACE_F (1, PostLoad, bool(const Scene *scene)) | |
Post processing of the asset. More... | |
Public Member Functions inherited from Clonable | |
LM_INTERFACE_CLASS (Clonable, Component, 1) | |
LM_DISABLE_COPY_AND_MOVE (Clonable) | |
LM_INTERFACE_F (0, Clone, void(Clonable *o)) | |
Clone the instalce. More... | |
Public Member Functions inherited from SIMDAlignedType | |
void * | operator new (std::size_t size) throw (std::bad_alloc) |
void | operator delete (void *p) |
Detailed Description
An interface for generalized BSDF.
Member Function Documentation
GeneralizedBSDF::LM_INTERFACE_F | ( | 0 | , |
Type | , | ||
int() | |||
) |
Generalized BSDF type.
- Returns
- Type.
GeneralizedBSDF::LM_INTERFACE_F | ( | 1 | , |
SampleDirection | , | ||
void(const Vec2 &u, Float uComp, int queryType, const SurfaceGeometry &geom, const Vec3 &wi, Vec3 &wo) | |||
) |
Sample outgoing vector.
Given the input direction wi
originated from the point geom.p
on the surface. The function samples outgoing vector wo
from the distribution in the solid angle measure according to the implementation.
Mathematically the function sample the direction from the distribution $p_{^}( | , {x})$. where $^$ is the projected solid angle measure, $$ is the incident direction, and ${x}$ is the surface position on the scene.
- Parameters
-
u Uniform random number in [0,1]^2. uComp Uniform random number for component selection in [0,1]. queryType SurfaceInteraction type for the sample query. geom Surface geometry information of the surface point. wi Incident direction. wo Sampled outgoing direction.
GeneralizedBSDF::LM_INTERFACE_F | ( | 2 | , |
EvaluateDirectionPDF | , | ||
Float(const SurfaceGeometry &geom, int queryType, const Vec3 &wi, const Vec3 &wo, bool evalDelta) | |||
) |
Evaluate PDF with the direction.
Evaluate the distribution used in SampleDirection. That is, $p_{^}( | , {x})$.
Some PDF contains delta component bound to some measures (e.g., ${^}()$ for specular reflection). we can ignore the delta component of the distribution by setting evalDelta
to false.
- Parameters
-
queryType SurfaceInteraction type for the sample query. geom Surface geometry information of the surface point. wi Incident direction. wo Outgoing direction. evalDelta true
if we do not want to ignore the delta function in the distribution, otherwisefalse
.
GeneralizedBSDF::LM_INTERFACE_F | ( | 3 | , |
EvaluateDirection | , | ||
SPD(const SurfaceGeometry &geom, int types, const Vec3 &wi, const Vec3 &wo, TransportDirection transDir, bool evalDelta) | |||
) |
Evaluate generalized BSDF.
The evaluation of the function differs according to the underlying generalized BSDF types. If the type is BSDF
, the function evaluates the BSDF $f_s$. If the type is L
, the function evaluates $L_e$. If the type is W
, the function evaluates $W_e$.
Also some BSDFs might contain delta functions. Again we can ignore the delta component of the distribution by setting evalDelta
to false.
In order to handle the asymetric case of BSDF [Veach 1998], we also need to pass the direction of light transport transDir
.
- Parameters
-
types SurfaceInteraction type for the evaluation query. geom Surface geometry information of the surface point. wi Incident direction. wo Outgoing direction. transDir Transport direction of the light transport. evalDelta true
if we do not want to ignore the delta function in the distribution, otherwisefalse
.
- Returns
- Evaluated contribution.