Torque 3D - Script Manual: RenderFormatToken Class Reference

TorqueScript

Main   Class List   Namespace List   Online

RenderFormatToken Class Reference
[GFX]

Used to change the render target format when rendering in AL. More...

Inheritance diagram for RenderFormatToken:

List of all members.

Public Attributes

int aaLevel
 Anti-ailiasing level for the this token. 0 disables, -1 uses adapter default.
PostEffect copyEffect
 This PostEffect will be run when the render target is changed to the format specified by this token. It is used to copy/format data into the token rendertarget.
GFXFormat depthFormat
 Sets the depth/stencil buffer format for this token.
GFXFormat format
 Sets the color buffer format for this token.
PostEffect resolveEffect
 This PostEffect will be run when the render target is changed back to the format active prior to this token. It is used to copy/format data from the token rendertarget to the backbuffer.

Detailed Description

Used to change the render target format when rendering in AL.

RenderFormatToken is an implementation which changes the format of the back buffer and/or the depth buffer.

The RenderPassStateBin manager changes the rendering state associated with this token. In stock Torque 3D, a single example exists in the way of AL_FormatToken (found in renderManager.cs). In that script file, all the render managers are intialized, and a single RenderFormatToken is used. This implementation basically exists to ensure Advanced Lighting works with MSAA.

The actions for this token toggle the format of the back/depth buffers and it lets you specify a custom shader to "copy" the data so it can be reformatted or altered. This is done through the variables copyEffect and resolveEffect (which are post processes just like fog or glow)

Example:
// This token, and the associated render managers, ensure that driver MSAA does not get used for Advanced Lighting renders.
// The 'AL_FormatResolve' PostEffect copies the result to the backbuffer.
new RenderFormatToken(AL_FormatToken)
{
   enabled = "false";

   format = "GFXFormatR8G8B8A8";
   depthFormat = "GFXFormatD24S8";
   aaLevel = 0; // -1 = match backbuffer

   // The contents of the back buffer before this format token is executed
   // is provided in $inTex
   copyEffect = "AL_FormatCopy";

   // The contents of the render target created by this format token is
   // provided in $inTex
   resolveEffect = "AL_FormatCopy";
};
See also:
RenderPassToken
RenderPassStateBin
game/core/scripts/client/renderManager.cs

Member Data Documentation

Anti-ailiasing level for the this token. 0 disables, -1 uses adapter default.

This PostEffect will be run when the render target is changed to the format specified by this token. It is used to copy/format data into the token rendertarget.

Sets the depth/stencil buffer format for this token.

Sets the color buffer format for this token.

This PostEffect will be run when the render target is changed back to the format active prior to this token. It is used to copy/format data from the token rendertarget to the backbuffer.



Copyright © GarageGames, LLC. All Rights Reserved.