RenderShaderAAFilter

Functions

SET_CID

IMPLEMENT_AS

RenderShaderAAFilter

~RenderShaderAAFilter

RED_RC

LoadProgram

RED_RC

EvaluateFromInputParameters

Detailed Description

class RenderShaderAAFilter : public RED::RenderShader

2D anti-aliasing post-processing filter.

@related Using Built-in Render Shaders, class RED::IMaterial, class RED::RenderShader, class RED::StateShader, class RED::RenderCode

This shader implements a 2D screen space anti-aliasing filter as a post-processing. It takes an input texture and return an anti-aliased version of that texture for all pixels in the image.

This shader can be used as rendering shader for a material assigned to a screen sized quadrilateral. If the quad’s geometry is matching the input texture size - which is the usual way to use this shader - it performs a camera viewport sized anti-aliasing filter on the provided source .

The source image may be any 2D image. Linear filtering must be enabled on the image for the shader to produce anti-aliased results. See RED::IImage2D::SetFilterModes.

This shader uses the RED::MCL_VERTEX channel of the input geometry.

This shader has no indirect lighting configuration and only creates the RED::HW_GENERIC hardware configuration.

All parameters declared by this shader are using the RED_SHAD_TARGET_LIGHT_NO_LIGHT shader target (commonly used in its shortcut form RED_L0).

See the REDRenderShaderAAFilter.h file documentation for the list of all #define statements used to name all parameters of this shader.

Public Functions

SET_CID(CID_class_REDRenderShaderAAFilter)
IMPLEMENT_AS()
RenderShaderAAFilter(RED::AA_FILTER iFilterName, const RED::Object *iTexture, RED::Object *iResMgr, RED_RC &oErrorCode)

Constructor.

Parameters
  • iFilterName – The anti-aliasing filter to use.

  • iTexture – Source image to process.

  • iResMgr – The cluster’s resource manager.

  • oErrorCode – Indicates a construction failure when not returned set to RED_OK.

virtual ~RenderShaderAAFilter()

Destructor.

Public Static Functions

static RED_RC LoadProgram(RED::String &oString, const RED::ShaderProgramID &iID)

Loads a shader program.

Generates a shader program that corresponds to the specified iID.

Parameters
  • oString – The created program string.

  • iID – The shader program unique ID.

Returns

RED_OK if the shader could be loaded,

RED_ALLOC_FAILURE if an allocation has failed,

RED_FAIL otherwise.

static RED_RC EvaluateFromInputParameters(RED::RenderShader *ioShader, RED::Object *iResMgr)

Evaluate a shader from its input parameters.

Parameters
  • ioShaderShader to redefine using its own input parameters.

  • iResMgr – The cluster’s resource manager.

Returns

RED_OK if the operation has succeeded,

RED_BAD_PARAM if iShader was not valid,

RED_BAD_PARAM if an invalid parameter was found during the evaluation,

RED_ALLOC_FAILURE if a memory allocation has failed,

Other RED_RC related to shader creation can be returned.