RenderMan  26.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RixNullBxdf Class Referenceabstract

#include <RixShadingBuiltin.h>

Inherits RixBxdf.

Public Types

enum  BxdfProperty { k_Albedo, k_MaterialIor }
 

Public Member Functions

virtual RixBXEvaluateDomain GetEvaluateDomain ()=0
 The domain over which this Bxdf evaluates samples. More...
 
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
 Generate sample data for each point. 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
 Do multiple evals at a single shading point. More...
 
RixShadingContext const * GetShadingCtx ()
 
RixBxdfFactoryGetBxdfFactory ()
 
virtual void GetAggregateLobeTraits (RixBXLobeTraits *t)=0
 The types of samples this BxdfEvaluator can generate. More...
 
PRMAN_INLINE RixBXLobeTraits GetAllLobeTraits ()
 
virtual RixSCDetail GetProperty (BxdfProperty property, void const **result) const =0
 Get material property Bxdfs can be queried for general material properties to facilitate integration tasks. More...
 
virtual bool EmitLocal (RtColorRGB *result)=0
 Used for baked, pre-integrated, indirect results. More...
 
virtual void Release ()
 Release does any cleanup that might be needed (often none and the base implementation is fine) and then calls the base implementation. More...
 

Protected Attributes

RixShadingContext const * shadingCtx
 
RixBxdfFactorybxdfFactory
 

Member Enumeration Documentation

enum RixBxdf::BxdfProperty
inherited
See Also
GetProperty
Enumerator
k_Albedo 

RtColorRGB.

k_MaterialIor 

float

Member Function Documentation

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

Used for baked, pre-integrated, indirect results.

A trivial implementation with no local emission should simply return false, indicating to the integrator that 'result' is untouched and that the integrator should not do anything with the results. For bxdfs that do have local emission, they should return true and write shadingCtx->numPts colors to the 'result' array. The integrator will then include the returned colors in the direct lighting for the geometry.

Parameters
[out]resultLocal emission color buffer
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.

Parameters
[in]transportTraitThe subset of light transport to consider
[in]lobesWantedSpecify lobes for evaluation
[in]rngRandom number generator
[out]lobesEvaluatedEvaluated lobe for each point in the ShadingContext
[out]directionsGenerated sample direction for each point (normalized)
[out]weightsGenerated lobe weights for each point
[out]forwardPdfsGenerated forward PDF for each point
[out]reversePdfsGenerated reverse PDF for each point

Implements RixBxdf.

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

Do multiple evals at a single shading point.

Also see the documentation above for EvaluateSample().

Parameters
[in]transportTraitThe subset of light transport to consider
[in]lobesWantedSpecify lobes for evaluation
[in]rngRandom number generator
[in]indexShading point index
[in]numSamplesNumber of evaluations at this point
[out]lobesEvaluatedEvaluated lobe for each point in the ShadingContext
[out]directionsGenerated sample direction for each point (normalized)
[out]weightsGenerated lobe weights for each point
[out]forwardPdfsGenerated forward PDF for each point
[out]reversePdfsGenerated reverse PDF for each point

Implements RixBxdf.

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

Generate sample data for each point.

A 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.

Parameters
[in]transportTraitThe subset of light transport to consider.
[in]lobesWantedSpecify lobes for evaluation.
[in]rngRandom number generator.
[out]lobesSampledSampled lobe for each point in the ShadingContext.
[out]directionsGenerated sample direction for each point (normalized).
[out]weightsGenerated lobe weights for each point.
[out]forwardPdfsGenerated forward PDF for each point.
[out]reversePdfsGenerated reverse PDF for each point.
[out]compTransGenerated color transmission for compositing.

Implements RixBxdf.

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

The types of samples this BxdfEvaluator can generate.

Referenced by RixBxdf::GetAllLobeTraits().

virtual void RixNullBxdf::GetAllLobeTraits ( RixBXLobeTraits )
pure virtual
PRMAN_INLINE RixBXLobeTraits RixBxdf::GetAllLobeTraits ( )
inlineinherited
RixBxdfFactory* RixBxdf::GetBxdfFactory ( )
inlineinherited

References RixBxdf::bxdfFactory.

virtual RixBXEvaluateDomain RixNullBxdf::GetEvaluateDomain ( )
pure virtual

The domain over which this Bxdf evaluates samples.

Note that it may Generate discrete samples in any direction, this only tells where incoming samples could Evaluate to non-zero.

Implements RixBxdf.

virtual int RixNullBxdf::GetNumLobes ( )
pure virtual
virtual RixSCDetail RixBxdf::GetProperty ( BxdfProperty  property,
void const **  result 
) const
pure virtualinherited

Get material property Bxdfs can be queried for general material properties to facilitate integration tasks.

Bxdfs should return k_RixSCInvalidDetail if a particular property is unsupported. If a property is supported Bxdf should return k_RixSCUniform or k_RixSCVarying according to the detail of the result. A trivial implementation that supports no properties of any sort should simply return k_RixSCInvalidDetail.

Parameters
[in]propertyProperty to query
[out]resultResults
RixShadingContext const* RixBxdf::GetShadingCtx ( )
inlineinherited

References RixBxdf::shadingCtx.

virtual void RixBxdf::Release ( )
inlinevirtualinherited

Release does any cleanup that might be needed (often none and the base implementation is fine) and then calls the base implementation.

A RixBxdf that contains another RixBxdf would need to call Release on its child as part of its own Release.

References RixBxdf::bxdfFactory, and RixBxdfFactory::EndScatter().

Member Data Documentation

RixBxdfFactory* RixBxdf::bxdfFactory
protectedinherited
RixShadingContext const* RixBxdf::shadingCtx
protectedinherited

Referenced by RixBxdf::GetShadingCtx().


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