![]() |
RenderManAPI
24.0
|
#include <RixBxdf.h>
Inherited by RixNullBxdf.
Public Types | |
enum | BxdfProperty { k_Albedo, k_MaterialIor } |
Public Member Functions | |
RixBxdf (RixShadingContext const *sCtx, RixBxdfFactory *factory) | |
virtual | ~RixBxdf () |
RixShadingContext const * | GetShadingCtx () |
RixBxdfFactory * | GetBxdfFactory () |
virtual RixBXEvaluateDomain | GetEvaluateDomain ()=0 |
virtual void | GetAggregateLobeTraits (RixBXLobeTraits *t)=0 |
PRMAN_INLINE RixBXLobeTraits | GetAllLobeTraits () |
virtual RixSCDetail | GetProperty (BxdfProperty, void const **result) const =0 |
virtual bool | EmitLocal (RtColorRGB *result)=0 |
virtual void | GenerateSample (RixBXTransportTrait transportTrait, RixBXLobeTraits const *lobesWanted, RixRNG *rng, RixBXLobeSampled *lobesSampled, RtVector3 *directions, RixBXLobeWeights &weights, float *forwardPdfs, float *reversePdfs, RtColorRGB *compTrans=NULL)=0 |
Bxdf is expected to generate a sample direction and lobe weights for each point in the ShadingContext (shadingCtx). More... | |
virtual void | EvaluateSample (RixBXTransportTrait transportTrait, RixBXLobeTraits const *lobesWanted, RixRNG *rng, RixBXLobeTraits *lobesEvaluated, RtVector3 const *directions, RixBXLobeWeights &weights, float *forwardPdfs, float *reversePdfs)=0 |
Bxdf is expected to evaluate itself subject to the lobesWanted request. More... | |
virtual void | EvaluateSamplesAtIndex (RixBXTransportTrait transportTrait, RixBXLobeTraits const &lobesWanted, RixRNG *rng, int index, int numSamples, RixBXLobeTraits *lobesEvaluated, RtVector3 const *directions, RixBXLobeWeights &weights, float *forwardPdfs, float *reversePdfs)=0 |
virtual void | Release () |
Protected Attributes | |
RixShadingContext const * | shadingCtx |
RixBxdfFactory * | bxdfFactory |
|
inline |
|
inlinevirtual |
|
pure virtual |
|
pure virtual |
Bxdf is expected to evaluate itself subject to the lobesWanted request.
In addition to directions, the ShadingContext variables (primarily Vn, Nn, Tn) must be consulted.
The lobesEvaluated output can be set to indicate invalid conditions. If and only if the bxdf is unable to satisfy the request, then lobesEvaluated should be set to invalid using SetValid(false). For example, if the lobesWanted argument requests a specific lobe (e.g., diffuse reflection) that the Bxdf does not support (for instance, that Bxdf only supports glossy reflections), then lobesEvaluated should be marked invalid. However, if it is possible to evaluate the request, then lobesEvaluated should not be marked as invalid (and should instead be set to the evaluated lobe for each point in the ShadingContext). For valid samples, usually the pdf will be non-zero but the weight may be set to 0 if there is no surface response for the given directions. In some cases, it is appropriate to set the pdf to zero when a given sample could never have been generated (for example, if the sample direction is below the horizon of the surface for a purely reflective surface).
This function can assume that the input directions are normalized.
directions | a result |
weights | more results: |
Implemented in RixNullBxdf.
|
pure virtual |
lobesEvaluated | results: |
Implemented in RixNullBxdf.
|
pure virtual |
Bxdf is expected to generate a sample direction and lobe weights for each point in the ShadingContext (shadingCtx).
Bxdfs must respect the transportTrait and lobesWanted request and indicate which class of lobe is associated with each sample by setting lobesSampled for each generated sample. If and only if the bxdf is unable to generate a requested sample, then lobesSampled should be marked as invalid using SetValid(false). For example, if the lobesWanted argument requests a specific lobe (e.g., diffuse reflection) that the Bxdf does not support (e.g. because it only supports glossy reflection), then lobesSampled should be marked as invalid. However, if it is possible to generate the requested samples, then lobesSampled should instead be set to the sampled lobe for each point in the ShadingContext. Note that it is possible for the returned lobe weights to be set to zero for one or more of the points in the ShadingContext when there is no surface response for the sampled directions, although usually the returned pdfs will be non-zero. The pdf should be set to zero only if the probability of the Bxdf model generating a given sample is zero (see the documentation for EvaluateSample() for an example where setting the pdf to zero is appropriate).
The generated sample directions must be normalized.
Bxdf can (but not expected to) return a colored transmission value in "compTrans" which is used to generate "alpha" in the integrator. The main purpose of this "alpha" is compositing. Bxdf should check against null pointer before setting compTrans. If compTrans is non zero (caller of GenerateSample is responsible for memory allocation of compTrans) and bxdf does not set compTrans, the integrator is responsible for setting compTrans to (0,0,0) by default.
lobesSampled | results: |
Implemented in RixNullBxdf.
|
pure virtual |
Referenced by GetAllLobeTraits().
|
inline |
References GetAggregateLobeTraits().
Referenced by PxrGeoAOV::Splat().
|
inline |
References bxdfFactory.
|
pure virtual |
Implemented in RixNullBxdf.
|
pure virtual |
|
inline |
References shadingCtx.
|
inlinevirtual |
References bxdfFactory, and RixBxdfFactory::EndScatter().
|
protected |
Referenced by GetBxdfFactory(), and Release().
|
protected |
Referenced by GetShadingCtx().