Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Latest commit

 

History

History
57 lines (36 loc) · 2.36 KB

RenderFormatToken.rst

File metadata and controls

57 lines (36 loc) · 2.36 KB

RenderFormatToken

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

Inherit:

RenderPassStateToken

Description

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.newRenderFormatToken(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 
   $inTexcopyEffect = "AL_FormatCopy";

   // The contents of the render target created by this format token is
   // provided in 
   $inTexresolveEffect = "AL_FormatCopy";
};

Fields