Class SamplingCallback

3DS Max Plug-In SDK

Class SamplingCallback

See Also: Class Sampler, Class ShadeContext, Class Color, Class Point2.

class SamplingCallback : public InterfaceServer

Description:

This class is available in release 3.0 and later only.

This is the callback object for the DoSamples() method of class Sampler. The SampleAtOffset() method is the one that actually computes the shading value for the Sampler.

Methods:

public:

Prototype:

virtual BOOL SampleAtOffset(Color &col, Color &trans, Point2& sample, float sampleScale)=0;

Remarks:

This is the method that integrates the sampler into the renderer. The plug-in Sampler calls this method to actually perform a sample at the specified 2D point. This method computes the output color and transparency.

Parameters:

Color &col

The output color.

Color &trans

The output transparency.

Point2& sample

The 2D sample point.

float sampleScale

The scale of the sample. This parameter is the way a sampler tells the shader to use the whole pixel (sampleScale=1) size for texture samples or some fraction. This scale is an edge scale not an area scale, so if you want samples 1/4 pixel large the sampleScale should be 1/2.

Return Value:

TRUE if the sample was processed; FALSE if the clipped sample was ignored.