RixOpacity Class Reference

RixOpacity Class Referenceabstract

#include <RixBxdf.h>

Public Member Functions

 RixOpacity (RixShadingContext const *sCtx, RixBxdfFactory *fact)
 
RixBxdfFactoryGetBxdfFactory ()
 
RixShadingContext const * GetShadingCtx ()
 
virtual bool GetPresence (RtFloat *result)=0
 
virtual bool GetOpacity (RtColorRGB *result)=0
 
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.

Member Function Documentation

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 ( RtFloat *  result)
pure virtual

GetPresence: fill shadingCtx->nPts worth of RtFloat 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).


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