Torque3D Documentation / _generateds / GFXTextureTarget

GFXTextureTarget

Engine/source/gfx/gfxTarget.h

A render target associated with one or more textures.

More...

Public Types

enum
RenderSlot {
  DepthStencil 
  Color0 
  Color1 
  Color2 
  Color3 
  Color4 
  Color5 
  MaxRenderSlotId 
}

Public Static Attributes

Protected Attributes

bool

Public Functions

attachTexture(RenderSlot slot, GFXCubemap * tex, U32 face, U32 mipLevel)

Support binding to cubemaps.

attachTexture(RenderSlot slot, GFXTextureObject * tex, U32 mipLevel, U32 zOffset)

Attach a surface to a given slot as part of this render target.

bool

Returns true if the automatic generation of mip maps is enabled.

Resolve the current render target data to the associated textures.

Detailed Description

A render target associated with one or more textures.

Although some APIs allow directly selecting any texture or surfaces, in some cases it is necessary to allocate helper resources to enable RTT operations.

note:

A GFXTextureTarget will retain references to textures that are attached to it, so be sure to clear them out when you're done!

note:

Different APIs have different restrictions on what they can support here. Be aware when mixing cubemaps vs. non-cubemaps, or targets of different resolutions. The devices will attempt to limit behavior to things that are safely portable, but they cannot catch every possible situation for all drivers and API - so make sure to actually test things!

Public Types

RenderSlot

Enumerator

DepthStencil
Color0
Color1
Color2
Color3
Color4
Color5
MaxRenderSlotId

Public Static Attributes

GFXTextureObject * sDefaultDepthStencil 

Protected Attributes

bool mGenMips 

Public Functions

~GFXTextureTarget()

attachTexture(RenderSlot slot, GFXCubemap * tex, U32 face, U32 mipLevel)

Support binding to cubemaps.

Parameters:

slot

What slot is used for multiple render target (MRT) effects. Most of the time you'll use Color0.

tex

What cubemap will we be rendering to?

face

A face identifier.

mipLevel

What level of this texture are we rendering to?

Reimplemented by: GFXD3D11TextureTarget, GFXGLTextureTarget

attachTexture(RenderSlot slot, GFXTextureObject * tex, U32 mipLevel, U32 zOffset)

Attach a surface to a given slot as part of this render target.

Parameters:

slot

What slot is used for multiple render target (MRT) effects. Most of the time you'll use Color0.

tex

A texture and miplevel to bind for rendering, or else NULL/0 to clear a slot.

mipLevel

What level of this texture are we rendering to?

zOffset

If this is a depth texture, what z level are we rendering to?

Reimplemented by: GFXD3D11TextureTarget, GFXGLTextureTarget

isGenMipsEnabled()

Returns true if the automatic generation of mip maps is enabled.

resolve()

Resolve the current render target data to the associated textures.

This method will get called automatically when a rendertarget is changed, before new geometry is drawn to a different rendertarget. This method can also be called to gather render target data without switching targets.

By default, this method will resolve all color targets.

Reimplemented by: GFXD3D11TextureTarget, GFXGLTextureTarget