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

RixOpacity objects are obtained from the BxdfFactory::BeginOpacity when it determines conditions warrant non-trivial responses to either or both of Presence and Opacity queries. More...

#include <RixBxdf.h>

Public Member Functions

 RixOpacity (RixShadingContext const *sCtx, RixBxdfFactory *factory)
 
virtual ~RixOpacity ()
 
RixBxdfFactoryGetBxdfFactory ()
 
RixShadingContext const * GetShadingCtx ()
 
virtual bool GetPresence (float *result)=0
 GetPresence: fill shadingCtx->nPts worth of float presence values. More...
 
virtual bool GetOpacity (RtColorRGB *result)=0
 GetOpacity: fill shadingCtx->nPts worth of RtColor opacity values. More...
 
virtual void Release ()
 

Protected Attributes

RixShadingContext const * shadingCtx
 
RixBxdfFactorybxdfFactory
 

Detailed Description

RixOpacity objects are obtained from the BxdfFactory::BeginOpacity when it determines conditions warrant non-trivial responses to either or both of Presence and Opacity queries.

GetPresence is invoked when an object isn't trivially 'present' and may be used for radiance queries to infer "ray continuation". It is useful to express cutouts as, for example, a leaf shape modeled with a texture map. Most objects are trivially present and the BxdfFactory should respond to NULL RixOpacity when the RixSCShadingMode is k_RixSCPresenceQuery. In the case of an opaque leaf, BxdfFactory should instantiate a RixOpacity subclass to respond to GetPresence requests and the "presence closure" should be constructed with the minimum state required to respond to this request. If our example leaf is opaque for shadowing, the BxdfFactory should respond to BeginOpacity requests with NULL for k_RixSCTransmissionQuery. But if the shadow of the leaf wants leaf coloration, BxdfFactory should produce a RixOpacity subclass that combines the effects of presence and coloration into a single opacity value. Since opacity can be colored, keep in mind that it is the inverse of transparency and user interfaces usually prefer to present a transparency color to the user.

Constructor & Destructor Documentation

RixOpacity::RixOpacity ( RixShadingContext const *  sCtx,
RixBxdfFactory factory 
)
inline
virtual RixOpacity::~RixOpacity ( )
inlinevirtual

Member Function Documentation

RixBxdfFactory* RixOpacity::GetBxdfFactory ( )
inline

References bxdfFactory.

virtual bool RixOpacity::GetOpacity ( RtColorRGB *  result)
pure virtual

GetOpacity: fill shadingCtx->nPts worth of RtColor opacity values.

Opacity values are used for transmission rays (usually shadows).

A return code of false signals that the object is fully opaque over the entirety of the shading context, whereas true signals that results are valid and need to be inspected by the renderer. A return value of false may also suggest that no RixOpacity object should have been constructed in the first place (the factory's GetOpacity should have returned NULL).

virtual bool RixOpacity::GetPresence ( float *  result)
pure virtual

GetPresence: fill shadingCtx->nPts worth of float presence values.

Values of 1 indicate fully present, 0 indicates fully absent, values in between indicate fractional presence and are useful for antialiasing.

A return code of false signals that the object is trivially present over the shading context, whereas true signals that results are valid and need to be inspected by the renderer. A return value of false may also suggest that no RixOpacity object should have been constructed in the first place (the factory's GetOpacity should have returned NULL).

RixShadingContext const* RixOpacity::GetShadingCtx ( )
inline

References shadingCtx.

virtual void RixOpacity::Release ( )
inlinevirtual

Member Data Documentation

RixBxdfFactory* RixOpacity::bxdfFactory
protected

Referenced by GetBxdfFactory(), and Release().

RixShadingContext const* RixOpacity::shadingCtx
protected

Referenced by GetShadingCtx().


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