RenderManAPI  24.0
RixDisplayServices Class Referenceabstract

Multiple methods of RixDisplayServices require similar parameters: More...

#include <RixIntegrator.h>

Public Member Functions

virtual bool Splat (RixChannelId id, int iCtxIndex, float const value)=0
 Accumulates a value into a given display channel for a given path sample. More...
 
virtual bool Splat (RixChannelId id, int iCtxIndex, RtColorRGB const value)=0
 The color version of RixDisplayServices::Splat(RixChannelId, int, float). More...
 
virtual bool SplatMulti (int nChans, RixChannelId const *ids, int iCtxIndex, float const value)=0
 The multi-channel version of Splat(), taking a list of channels to accumulate to. More...
 
virtual bool SplatMulti (int nChans, RixChannelId const *id, int iCtxIndex, RtColorRGB const value)=0
 The color version of RixDisplayServices::SplatMulti(int, RixChannelId*, int, float). More...
 
virtual bool Write (RixChannelId id, int iCtxIndex, float const value)=0
 Write() is similar to Splat(), except that it overwrites the existing value instead of accumulating. More...
 
virtual bool Write (RixChannelId id, int iCtxIndex, RtColorRGB const value)=0
 The color version of RixDisplayServices::Write(int, RixChannelId, float). More...
 
virtual bool Write (RixChannelId id, int iCtxIndex, int const value)=0
 The integer version of RixDisplayServices::Write(int, RixChannelId, float). More...
 
virtual void WriteDistance (int const iCtxIndex, float const distance, bool const isVolume=true, RixShadingContext const *sCtx=nullptr)=0
 Overwrites the existing hit distance and information. More...
 
virtual void WriteOpacity (RixChannelId id, int iCtxIndex, float const value)=0
 Overwrites the current opacity value into the sample, which will be pixel-filtered and blended to create the pixel alpha. More...
 
virtual void WriteOpacity (RixChannelId id, int iCtxIndex, RtColorRGB &value)=0
 
virtual void SplatOpacity (RixChannelId id, int iCtxIndex, float const opacity)=0
 Accumulates a given opacity value into the sample, which will be pixel-filtered and blended to create the pixel alpha. More...
 
virtual void SplatOpacity (RixChannelId id, int iCtxIndex, RtColorRGB &opacity)=0
 
virtual int AddSample (int iCtxIndex)=0
 Creates and adds a new sample. More...
 
virtual void GetDisplayChannels (int *numDisplays, RixDisplayChannel const **displays)=0
 Gets a list of available display channels. More...
 
virtual void DiscardIteration (bool redo=false)=0
 Cancels the results of any calls made to Splat(), SplatMulti(), and Write() during this invocation of the integrator's Integrate() or IntegrateRays() method. More...
 

Protected Member Functions

virtual ~RixDisplayServices ()
 

Detailed Description

Multiple methods of RixDisplayServices require similar parameters:

  • the id of the channel we want to write/splat a value to. This id is usually obtained by introspecting the list of RixDisplayChannel objects that can be retrieved from the RixIntegratorEnvironment interface. This list can also be retrived by calling the method GetDisplayChannels().
  • an integrator context index. This is the index of the primary ray associated with the sample. When looping over points in a RixShadingContext, this should be sCtx.integratorCtxIndex[i]

Most methods have two versions, differing only by the type of the provided value: float or color.

Constructor & Destructor Documentation

◆ ~RixDisplayServices()

virtual RixDisplayServices::~RixDisplayServices ( )
inlineprotectedvirtual

Member Function Documentation

◆ AddSample()

virtual int RixDisplayServices::AddSample ( int  iCtxIndex)
pure virtual

Creates and adds a new sample.

This new sample will be located at the same screen position as the given sample. However, it may be assigned different values and hit distances. Use this to produce better deep images from transparency and volumes. The returned value can be used as the iCtxIndex for the new sample in other calls or to add further samples.

Note: if there is anything in front of this new sample, the integrator is still responsible for attenuating any color and opacity splatted into it.

Parameters
[in]iCtxIndexIntegrator context index of the original sample.
Returns
a new integrator context index that must be used when calling Write() or Splat() methods for this additional sample.

◆ DiscardIteration()

virtual void RixDisplayServices::DiscardIteration ( bool  redo = false)
pure virtual

Cancels the results of any calls made to Splat(), SplatMulti(), and Write() during this invocation of the integrator's Integrate() or IntegrateRays() method.

This may be useful if an integrator produces poor estimates during a warmup period.

Parameters
[in]redoIf true, the renderer will retry the current integration with the same inputs. Optional.

◆ GetDisplayChannels()

virtual void RixDisplayServices::GetDisplayChannels ( int *  numDisplays,
RixDisplayChannel const **  displays 
)
pure virtual

Gets a list of available display channels.

These are normally provided to the integrator via the integration environment for it to inspect during startup. However, we provide access here during runtime for more dynamic applications such as patterns and bxdfs which would like to do "writeaov()"-like things.

Parameters
[out]numDisplaysNumber of displays returned.
[out]displaysList of displays. Array of size numDisplays.

◆ Splat() [1/2]

virtual bool RixDisplayServices::Splat ( RixChannelId  id,
int  iCtxIndex,
float const  value 
)
pure virtual

Accumulates a value into a given display channel for a given path sample.

This is accumulative; it may be called at each vertex along a light path to sum radiance thruput, for example.

Note: RixPattern plug-ins should only write to display services during scatter queries. Users can check the shading context shading mode for k_RixSCScatterQuery.

Parameters
[in]idId of the channel to write to.
[in]iCtxIndexIntegrator context index.
[in]valueThe value to be splat.
Returns
true on success (i.e. if channel exists for the camera currently being processed).

◆ Splat() [2/2]

virtual bool RixDisplayServices::Splat ( RixChannelId  id,
int  iCtxIndex,
RtColorRGB const  value 
)
pure virtual

◆ SplatMulti() [1/2]

virtual bool RixDisplayServices::SplatMulti ( int  nChans,
RixChannelId const *  ids,
int  iCtxIndex,
float const  value 
)
pure virtual

The multi-channel version of Splat(), taking a list of channels to accumulate to.

The same value will be accumulated into each channel.

Parameters
nChansNumber of channels ids.
idsIds of the channels to write to.
[in]iCtxIndexIntegrator context index.
[in]valueThe value to be splat.
Returns
true on success (i.e. if all channel exists for the camera currently being processed).

◆ SplatMulti() [2/2]

virtual bool RixDisplayServices::SplatMulti ( int  nChans,
RixChannelId const *  id,
int  iCtxIndex,
RtColorRGB const  value 
)
pure virtual

The color version of RixDisplayServices::SplatMulti(int, RixChannelId*, int, float).

◆ SplatOpacity() [1/2]

virtual void RixDisplayServices::SplatOpacity ( RixChannelId  id,
int  iCtxIndex,
float const  opacity 
)
pure virtual

Accumulates a given opacity value into the sample, which will be pixel-filtered and blended to create the pixel alpha.

Parameters
[in]idId of the channel to write to.
[in]iCtxIndexIntegrator context index.
[in]opacityThe value to be written.

◆ SplatOpacity() [2/2]

virtual void RixDisplayServices::SplatOpacity ( RixChannelId  id,
int  iCtxIndex,
RtColorRGB opacity 
)
pure virtual

◆ Write() [1/3]

virtual bool RixDisplayServices::Write ( RixChannelId  id,
int  iCtxIndex,
float const  value 
)
pure virtual

Write() is similar to Splat(), except that it overwrites the existing value instead of accumulating.

This can be useful for AOVs that do not sum linearly.

The last write into the given channel will be the one that gets filtered into the pixel for this particular sample. It is up to the user to manage their shader networks to avoid plugins fighting over the value.

Parameters
[in]idId of the channel to write to.
[in]iCtxIndexIntegrator context index.
[in]valueThe value to be written.
Returns
true on success (i.e. if channel exists for the camera currently being processed).

◆ Write() [2/3]

virtual bool RixDisplayServices::Write ( RixChannelId  id,
int  iCtxIndex,
RtColorRGB const  value 
)
pure virtual

The color version of RixDisplayServices::Write(int, RixChannelId, float).

◆ Write() [3/3]

virtual bool RixDisplayServices::Write ( RixChannelId  id,
int  iCtxIndex,
int const  value 
)
pure virtual

The integer version of RixDisplayServices::Write(int, RixChannelId, float).

◆ WriteDistance()

virtual void RixDisplayServices::WriteDistance ( int const  iCtxIndex,
float const  distance,
bool const  isVolume = true,
RixShadingContext const *  sCtx = nullptr 
)
pure virtual

Overwrites the existing hit distance and information.

When using deep outputs, this must be called during volume integration for them to be correct.

Only one update can be saved per sample, so only the last call to WriteDistance() for a given sample has an effect. Use AddSample() with this if you'd like to have distinct samples at different distances.

Parameters
[in]iCtxIndexIntegrator context index.
[in]distanceThis is not the distance to the outer envelope, but to a volume scattering or absorption event or to a non-volume object intersecting the volume.
[in]isVolumeIndicates if writing distance for a volume scattering event or not.
[in]sCtxThe shading context associated with the point for which we are writing the distance. This is necessary for RixSampleFilter::GetAttribute() to work properly.

Referenced by RixIntegrator::IntegrateRays().

◆ WriteOpacity() [1/2]

virtual void RixDisplayServices::WriteOpacity ( RixChannelId  id,
int  iCtxIndex,
float const  value 
)
pure virtual

Overwrites the current opacity value into the sample, which will be pixel-filtered and blended to create the pixel alpha.

Parameters
[in]idId of the channel to write to.
[in]iCtxIndexIntegrator context index.
[in]opacityThe value to be written.

◆ WriteOpacity() [2/2]

virtual void RixDisplayServices::WriteOpacity ( RixChannelId  id,
int  iCtxIndex,
RtColorRGB value 
)
pure virtual

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