RenderManAPI  24.0
RixNullBxdf Class Referenceabstract

#include <RixShadingBuiltin.h>

Inherits RixBxdf.

Public Types

enum  BxdfProperty { k_Albedo, k_MaterialIor }
 

Public Member Functions

virtual RixBXEvaluateDomain GetEvaluateDomain ()=0
 
virtual void GetAllLobeTraits (RixBXLobeTraits *)=0
 
virtual int GetNumLobes ()=0
 
virtual void GenerateSample (RixBXTransportTrait transportTrait, RixBXLobeTraits const *lobesWanted, RixRNG *rng, RixBXLobeSampled *lobeSampled, 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 nSamples, RixBXLobeTraits *lobesEvaluated, RtVector3 const *directions, RixBXLobeWeights &weights, float *forwardPdfs, float *reversePdfs)=0
 
RixShadingContext const * GetShadingCtx ()
 
RixBxdfFactoryGetBxdfFactory ()
 
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 Release ()
 

Protected Attributes

RixShadingContext const * shadingCtx
 
RixBxdfFactorybxdfFactory
 

Member Enumeration Documentation

◆ BxdfProperty

enum RixBxdf::BxdfProperty
inherited
Enumerator
k_Albedo 
k_MaterialIor 

Member Function Documentation

◆ EmitLocal()

virtual bool RixBxdf::EmitLocal ( RtColorRGB result)
pure virtualinherited

◆ EvaluateSample()

virtual void RixNullBxdf::EvaluateSample ( RixBXTransportTrait  transportTrait,
RixBXLobeTraits const *  lobesWanted,
RixRNG rng,
RixBXLobeTraits lobesEvaluated,
RtVector3 const *  directions,
RixBXLobeWeights weights,
float *  forwardPdfs,
float *  reversePdfs 
)
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.

Implements RixBxdf.

◆ EvaluateSamplesAtIndex()

virtual void RixNullBxdf::EvaluateSamplesAtIndex ( RixBXTransportTrait  transportTrait,
RixBXLobeTraits const &  lobesWanted,
RixRNG rng,
int  index,
int  nSamples,
RixBXLobeTraits lobesEvaluated,
RtVector3 const *  directions,
RixBXLobeWeights weights,
float *  forwardPdfs,
float *  reversePdfs 
)
pure virtual

Implements RixBxdf.

◆ GenerateSample()

virtual void RixNullBxdf::GenerateSample ( RixBXTransportTrait  transportTrait,
RixBXLobeTraits const *  lobesWanted,
RixRNG rng,
RixBXLobeSampled lobesSampled,
RtVector3 directions,
RixBXLobeWeights weights,
float *  forwardPdfs,
float *  reversePdfs,
RtColorRGB compTrans = NULL 
)
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.

Implements RixBxdf.

◆ GetAggregateLobeTraits()

virtual void RixBxdf::GetAggregateLobeTraits ( RixBXLobeTraits t)
pure virtualinherited

◆ GetAllLobeTraits() [1/2]

virtual void RixNullBxdf::GetAllLobeTraits ( RixBXLobeTraits )
pure virtual

◆ GetAllLobeTraits() [2/2]

PRMAN_INLINE RixBXLobeTraits RixBxdf::GetAllLobeTraits ( )
inlineinherited

◆ GetBxdfFactory()

RixBxdfFactory* RixBxdf::GetBxdfFactory ( )
inlineinherited

References RixBxdf::bxdfFactory.

◆ GetEvaluateDomain()

virtual RixBXEvaluateDomain RixNullBxdf::GetEvaluateDomain ( )
pure virtual

Implements RixBxdf.

◆ GetNumLobes()

virtual int RixNullBxdf::GetNumLobes ( )
pure virtual

◆ GetProperty()

virtual RixSCDetail RixBxdf::GetProperty ( BxdfProperty  ,
void const **  result 
) const
pure virtualinherited

◆ GetShadingCtx()

RixShadingContext const* RixBxdf::GetShadingCtx ( )
inlineinherited

References RixBxdf::shadingCtx.

◆ Release()

virtual void RixBxdf::Release ( )
inlinevirtualinherited

Member Data Documentation

◆ bxdfFactory

RixBxdfFactory* RixBxdf::bxdfFactory
protectedinherited

◆ shadingCtx

RixShadingContext const* RixBxdf::shadingCtx
protectedinherited

Referenced by RixBxdf::GetShadingCtx().


The documentation for this class was generated from the following file: