GFX

More...

Classes:

class

Used to create static or dynamic cubemaps.

class

A debug helper for rendering debug primitives to the scene.

class

This class is the interface between TorqueScript and GFXCardProfiler.

class

Functions for tracking GFX adapters and initializing them into devices.

class

A sampler state used by GFXStateBlockData.

class

A state block description for rendering.

class

A material in Torque 3D is a data structure that describes a surface.

class

Singleton class that exposes ConsoleStaticFunctions for debug visualizing PostEffects.

class

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

Enumerations

enum
GFXAdapterType {
  OpenGL 
  D3D11 
  NullDevice 
}

Back-end graphics API used by the GFX subsystem.

enum
GFXBlend {
  GFXBlendZero 
  GFXBlendOne 
  GFXBlendSrcColor 
  GFXBlendInvSrcColor 
  GFXBlendSrcAlpha 
  GFXBlendInvSrcAlpha 
  GFXBlendDestAlpha 
  GFXBlendInvDestAlpha 
  GFXBlendDestColor 
  GFXBlendInvDestColor 
  GFXBlendSrcAlphaSat 
}

The supported blend modes.

enum
GFXBlendOp {
  GFXBlendOpAdd 
  GFXBlendOpSubtract 
  GFXBlendOpRevSubtract 
  GFXBlendOpMin 
  GFXBlendOpMax 
}

The blend operators.

enum
GFXCmpFunc {
  GFXCmpNever 
  GFXCmpLess 
  GFXCmpEqual 
  GFXCmpLessEqual 
  GFXCmpGreater 
  GFXCmpNotEqual 
  GFXCmpGreaterEqual 
  GFXCmpAlways 
}

The supported comparison functions.

enum
GFXCullMode {
  GFXCullNone 
  GFXCullCW 
  GFXCullCCW 
}

The render cull modes.

enum
GFXFormat {
  GFXFormatR8G8B8 
  GFXFormatR8G8B8A8 
  GFXFormatR8G8B8A8_SRGB 
  GFXFormatR8G8B8X8 
  GFXFormatR32F 
  GFXFormatR5G6B5 
  GFXFormatR5G5B5A1 
  GFXFormatR5G5B5X1 
  GFXFormatA4L4 
  GFXFormatA8L8 
  GFXFormatA8 
  GFXFormatL8 
  GFXFormatBC1 
  GFXFormatBC2 
  GFXFormatBC3 
  GFXFormatBC4 
  GFXFormatBC5 
  GFXFormatD32 
  GFXFormatD24X8 
  GFXFormatD24S8 
  GFXFormatD24FS8 
  GFXFormatD16 
  GFXFormatR32G32B32A32F 
  GFXFormatR16G16B16A16F 
  GFXFormatL16 
  GFXFormatR16G16B16A16 
  GFXFormatR16G16 
  GFXFormatR16F 
  GFXFormatR16G16F 
  GFXFormatR10G10B10A2 
}

The texture formats.

enum
GFXStencilOp {
  GFXStencilOpKeep 
  GFXStencilOpZero 
  GFXStencilOpReplace 
  GFXStencilOpIncrSat 
  GFXStencilOpDecrSat 
  GFXStencilOpInvert 
  GFXStencilOpIncr 
  GFXStencilOpDecr 
}

The stencil operators.

enum
GFXTextureAddressMode {
  GFXAddressWrap 
  GFXAddressMirror 
  GFXAddressClamp 
  GFXAddressBorder 
  GFXAddressMirrorOnce 
}

The texture address modes.

enum
GFXTextureFilterType {
  GFXTextureFilterNone 
  GFXTextureFilterPoint 
  GFXTextureFilterLinear 
  GFXTextureFilterAnisotropic 
}

The texture filter types.

enum
MaterialAnimType {
  Scroll 
  Rotate 
  Wave 
  Scale 
  Sequence 
}

The type of animation effect to apply to this material.

enum
MaterialBlendOp {
  None 
  Mul 
  PreMul 
  Add 
  AddAlpha 
  Sub 
  LerpAlpha 
}

The type of graphical blending operation to apply to this material.

enum
MaterialWaveType {
  Sin 
  Triangle 
  Square 
}

When using the Wave material animation, one of these Wave Types will be used to determine the type of wave to display.

Functions

void

Release the unused pooled textures in texture manager freeing up video memory.

void

Clears the flagged state on all allocated GFX resources. See flagCurrentGFXResources for usage details.

void
describeGFXResources(string resourceTypes, string filePath, bool unflaggedOnly)

Dumps a description of GFX resources to a file or the console.

void
describeGFXStateBlocks(string filePath)

Dumps a description of all state blocks.

void

Creates a 64x64 normal map texture filled with noise. The texture is saved to randNormTex.png in the location of the game executable.

void

Dumps a list of all active texture objects to the console.

void

Flags all currently allocated GFX resources. Used for resource allocation and leak tracking by flagging current resources then dumping a list of unflagged resources at some later point in execution.

void

Releases all textures and resurrects the texture manager.

int

Return the number of graphics adapters available.

Returns the best texture format for storage of HDR data for the active device.

Point3F

Returns the width, height, and bitdepth of the screen/desktop.

string

Get the string describing the active GFX device.

String

Returns a tab-seperated string of the detected devices across all adapters.

Get the string describing the active GFX device type.

float

Returns the pixel shader version for the active device.

String

Returns a list of texture profiles in the format: ProfileName TextureCount TextureMB.

void
listGFXResources(bool unflaggedOnly)

Returns a list of the unflagged GFX resources. See flagCurrentGFXResources for usage details.

void

Reload all the textures from disk.

void
screenShot(string file, string format, uint tileCount, float tileOverlap)

Takes a screenshot with optional tiling to produce huge screenshots.

void
setPixelShaderVersion(float version)

Sets the pixel shader version for the active device. This can be used to force a lower pixel shader version than is supported by the device for testing or performance optimization.

void

Set the reflection texture format.

Variables

string

The file path of the texture used as the default irradiance cubemap for PBR.

string

The file path of the texture used as the default irradiance cubemap for PBR.

string

The file path of the texture used as the default specular cubemap for PBR.

bool

Debug helper that disables all hardware occlusion queries causing them to return only the visibile state.

bool

Disables vertical sync on the active device.

bool

On supported devices this will dump shader disassembly to the procedural shader folder.

float

Will force the shader model if the value is positive and less than the shader model supported by the active device. Use 0 for fixed function.

string

The file path of the texture to display when the requested texture is missing.

int

The number of mipmap levels to drop on loaded textures to reduce video memory usage. It will skip any textures that have been defined as not allowing down scaling.

string

The file path of the texture to display when the requested texture is unavailable.

string

The file path of the texture used to warn the developer.

bool

Used to toggle wireframe rendering at runtime.

Detailed Description

Enumerations

GFXAdapterType

Enumerator

OpenGL

OpenGL.

D3D11

Direct3D 11.

NullDevice

Null device for dedicated servers.

Back-end graphics API used by the GFX subsystem.

GFXBlend

Enumerator

GFXBlendZero

(0, 0, 0, 0)

GFXBlendOne

(1, 1, 1, 1)

GFXBlendSrcColor

(Rs, Gs, Bs, As)

GFXBlendInvSrcColor

(1 - Rs, 1 - Gs, 1 - Bs, 1 - As)

GFXBlendSrcAlpha

(As, As, As, As)

GFXBlendInvSrcAlpha

( 1 - As, 1 - As, 1 - As, 1 - As)

GFXBlendDestAlpha

(Ad Ad Ad Ad)

GFXBlendInvDestAlpha

(1 - Ad 1 - Ad 1 - Ad 1 - Ad)

GFXBlendDestColor

(Rd, Gd, Bd, Ad)

GFXBlendInvDestColor

(1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad)

GFXBlendSrcAlphaSat

(f, f, f, 1) where f = min(As, 1 - Ad)

The supported blend modes.

GFXBlendOp

Enumerator

GFXBlendOpAdd
GFXBlendOpSubtract
GFXBlendOpRevSubtract
GFXBlendOpMin
GFXBlendOpMax

The blend operators.

GFXCmpFunc

Enumerator

GFXCmpNever
GFXCmpLess
GFXCmpEqual
GFXCmpLessEqual
GFXCmpGreater
GFXCmpNotEqual
GFXCmpGreaterEqual
GFXCmpAlways

The supported comparison functions.

GFXCullMode

Enumerator

GFXCullNone
GFXCullCW
GFXCullCCW

The render cull modes.

GFXFormat

Enumerator

GFXFormatR8G8B8
GFXFormatR8G8B8A8
GFXFormatR8G8B8A8_SRGB
GFXFormatR8G8B8X8
GFXFormatR32F
GFXFormatR5G6B5
GFXFormatR5G5B5A1
GFXFormatR5G5B5X1
GFXFormatA4L4
GFXFormatA8L8
GFXFormatA8
GFXFormatL8
GFXFormatBC1
GFXFormatBC2
GFXFormatBC3
GFXFormatBC4
GFXFormatBC5
GFXFormatD32
GFXFormatD24X8
GFXFormatD24S8
GFXFormatD24FS8
GFXFormatD16
GFXFormatR32G32B32A32F
GFXFormatR16G16B16A16F
GFXFormatL16
GFXFormatR16G16B16A16
GFXFormatR16G16
GFXFormatR16F
GFXFormatR16G16F
GFXFormatR10G10B10A2

The texture formats.

note:

Not all formats are supported on all platforms.

GFXStencilOp

Enumerator

GFXStencilOpKeep
GFXStencilOpZero
GFXStencilOpReplace
GFXStencilOpIncrSat
GFXStencilOpDecrSat
GFXStencilOpInvert
GFXStencilOpIncr
GFXStencilOpDecr

The stencil operators.

GFXTextureAddressMode

Enumerator

GFXAddressWrap
GFXAddressMirror
GFXAddressClamp
GFXAddressBorder
GFXAddressMirrorOnce

The texture address modes.

GFXTextureFilterType

Enumerator

GFXTextureFilterNone
GFXTextureFilterPoint
GFXTextureFilterLinear
GFXTextureFilterAnisotropic

The texture filter types.

MaterialAnimType

Enumerator

Scroll

Scroll the material along the X/Y axis.

Rotate

Rotate the material around a point.

Wave

Warps the material with an animation using Sin, Triangle or Square mathematics.

Scale

Scales the material larger and smaller with a pulsing effect.

Sequence

Enables the material to have multiple frames of animation in its imagemap.

The type of animation effect to apply to this material.

MaterialBlendOp

Enumerator

None

Simple point sampled filtering. This is the fastest and lowest quality mode.

No transition. Immediately move on to processing the slot or immediately move on to the next slot.

Allow both childs to resize (default).

Disable blending for this material.

No mesh data.

Mul

Multiplicative blending.

PreMul

Premultiplied alpha.

Add

Adds the color of the material to the frame buffer with full alpha for each pixel.

AddAlpha

The color is modulated by the alpha channel before being added to the frame buffer.

Sub

Subtractive Blending. Reverses the color model, causing dark colors to have a stronger visual effect.

LerpAlpha

Linearly interpolates between Material color and frame buffer color based on alpha.

The type of graphical blending operation to apply to this material.

MaterialWaveType

Enumerator

Sin

Warps the material along a curved Sin Wave.

Triangle

Warps the material along a sharp Triangle Wave.

Square

Warps the material along a wave which transitions between two oppposite states. As a Square Wave, the transition is quick and sudden.

When using the Wave material animation, one of these Wave Types will be used to determine the type of wave to display.

Functions

cleanupTexturePool()

Release the unused pooled textures in texture manager freeing up video memory.

clearGFXResourceFlags()

Clears the flagged state on all allocated GFX resources. See flagCurrentGFXResources for usage details.

describeGFXResources(string resourceTypes, string filePath, bool unflaggedOnly)

Dumps a description of GFX resources to a file or the console.

Parameters:

resourceTypes

A space seperated list of resource types or an empty string for all resources.

filePath

A file to dump the list to or an empty string to write to the console.

unflaggedOnly

If true only unflagged resources are dumped. See flagCurrentGFXResources.

note:

The resource types can be one or more of the following:

  • texture

  • texture target

  • window target

  • vertex buffers

  • primitive buffers

  • fences

  • cubemaps

  • shaders

  • stateblocks

describeGFXStateBlocks(string filePath)

Dumps a description of all state blocks.

Parameters:

filePath

A file to dump the state blocks to or an empty string to write to the console.

dumpRandomNormalMap()

Creates a 64x64 normal map texture filled with noise. The texture is saved to randNormTex.png in the location of the game executable.

dumpTextureObjects()

Dumps a list of all active texture objects to the console.

note:

This function is only available in debug builds.

flagCurrentGFXResources()

Flags all currently allocated GFX resources. Used for resource allocation and leak tracking by flagging current resources then dumping a list of unflagged resources at some later point in execution.

flushTextureCache()

Releases all textures and resurrects the texture manager.

getAdapterCount()

Return the number of graphics adapters available.

getBestHDRFormat()

Returns the best texture format for storage of HDR data for the active device.

getDesktopResolution()

Returns the width, height, and bitdepth of the screen/desktop.

getDisplayDeviceInformation()

Get the string describing the active GFX device.

getDisplayDeviceList()

Returns a tab-seperated string of the detected devices across all adapters.

getDisplayDeviceType()

Get the string describing the active GFX device type.

getPixelShaderVersion()

Returns the pixel shader version for the active device.

getTextureProfileStats()

Returns a list of texture profiles in the format: ProfileName TextureCount TextureMB.

listGFXResources(bool unflaggedOnly)

Returns a list of the unflagged GFX resources. See flagCurrentGFXResources for usage details.

reloadTextures()

Reload all the textures from disk.

screenShot(string file, string format, uint tileCount, float tileOverlap)

Takes a screenshot with optional tiling to produce huge screenshots.

Parameters:

file

The output image file path.

format

Either JPEG or PNG.

tileCount

If greater than 1 will tile the current screen size to take a large format screenshot.

tileOverlap

The amount of horizontal and vertical overlap between the tiles used to remove tile edge artifacts from post effects.

setPixelShaderVersion(float version)

Sets the pixel shader version for the active device. This can be used to force a lower pixel shader version than is supported by the device for testing or performance optimization.

Parameters:

version

The floating point shader version number.

note:

This will only affect shaders/materials created after the call and should be used before the game begins.

setReflectFormat(GFXFormat format)

Set the reflection texture format.

Variables

string BRDFTexture 

The file path of the texture used as the default irradiance cubemap for PBR.

string DefaultIrradianceCubemap 

The file path of the texture used as the default irradiance cubemap for PBR.

string DefaultPrefilterCubemap 

The file path of the texture used as the default specular cubemap for PBR.

bool disableOcclusionQuery 

Debug helper that disables all hardware occlusion queries causing them to return only the visibile state.

bool disableVerticalSync 

Disables vertical sync on the active device.

note:

The video mode must be reset for the change to take affect.

bool disassembleAllShaders 

On supported devices this will dump shader disassembly to the procedural shader folder.

float forcedPixVersion 

Will force the shader model if the value is positive and less than the shader model supported by the active device. Use 0 for fixed function.

note:

The graphics device must be reset for the change to take affect.

string missingTexturePath 

The file path of the texture to display when the requested texture is missing.

int textureReductionLevel 

The number of mipmap levels to drop on loaded textures to reduce video memory usage. It will skip any textures that have been defined as not allowing down scaling.

string unavailableTexturePath 

The file path of the texture to display when the requested texture is unavailable.

Often this texture is used by GUI controls to indicate that the request image is unavailable.

string warningTexturePath 

The file path of the texture used to warn the developer.

bool wireframe 

Used to toggle wireframe rendering at runtime.