UTextureRenderTarget2D

TextureRenderTarget2D

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Engine/TextureRenderTarget2D.h

Include

#include "Engine/TextureRenderTarget2D.h"

Syntax

class UTextureRenderTarget2D : public UTextureRenderTarget

Remarks

TextureRenderTarget2D

2D render target texture resource. This can be used as a target for rendering as well as rendered as a regular 2D texture resource.

Variables

Name Description

Public variable

TEnumAsByte< en...

 

AddressX

The addressing mode to use for the X axis.

Public variable

TEnumAsByte< en...

 

AddressY

The addressing mode to use for the Y axis.

Public variable

uint8: 1

 

bAutoGenerateMips

Whether to support Mip maps for this render target texture

Public variable

uint8: 1

 

bForceLinearGamma

True to force linear gamma space for this render target

Public variable

uint8: 1

 

bGPUSharedFlag

Whether to support GPU sharing of the underlying native texture resource.

Public variable

FLinearColor

 

ClearColor

The color the texture is cleared to

Public variable

TEnumAsByte< en...

 

MipsAddressU

AutoGenerateMips sampler address mode for U channel. Defaults to clamp.

Public variable

TEnumAsByte< en...

 

MipsAddressV

AutoGenerateMips sampler address mode for V channel. Defaults to clamp.

Public variable

TEnumAsByte< en...

 

MipsSamplerFilter

Sampler filter type for AutoGenerateMips. Defaults to match texture filter.

Public variable

TEnumAsByte< en...

 

OverrideFormat

Normally the format is derived from RenderTargetFormat, this allows code to set the format explicitly.

Public variable

TEnumAsByte< en...

 

RenderTargetFormat

Format of the texture render target.

Public variable

int32

 

SizeX

The width of the texture.

Public variable

int32

 

SizeY

The height of the texture.

Constructors

Name Description

Public function

UTextureRenderTarget2D

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

UTexture2D &...

 

ConstructTexture2D

(
    UObject* InOuter,
    const FString& NewTexName,
    EObjectFlags InObjectFlags,
    uint32 Flags,
    TArray< uint8 >* AlphaOverride
)

Utility for creating a new UTexture2D from a TextureRenderTarget2D TextureRenderTarget2D must be square and a power of two size.

Public function Const

EPixelFormat

 

GetFormat()

Public function Const

int32

 

GetNumMips()

Public function

void

 

InitAutoFormat

(
    uint32 InSizeX,
    uint32 InSizeY
)

Initializes the render target, the format will be derived from the value of bHDR.

Public function

void

 

InitCustomFormat

(
    uint32 InSizeX,
    uint32 InSizeY,
    EPixelFormat InOverrideFormat,
    bool bInForceLinearGamma
)

Initialize the settings needed to create a render target texture and create its resource

Public function

void

 

ResizeTarget

(
    uint32 InSizeX,
    uint32 InSizeY
)

Resizes the render target without recreating the FTextureResource.

Public function

void

 

UpdateResourceImmediate

(
    bool bClearRenderTarget
)

Updates (resolves) the render target texture immediately.

Overridden from UTexture

Name Description

Public function Virtual

FTextureReso...

 

CreateResource()

Implemented by subclasses to create a new resource for the texture.

Public function Virtual Const

EMaterialVal...

 

GetMaterialType()

Public function Virtual Const

float

 

GetSurfaceHeight()

Public function Virtual Const

float

 

GetSurfaceWidth()

Overridden from UObject

Name Description

Public function Virtual

FString

 

GetDesc()

Return a one line description of an object for viewing in the thumbnail view of the generic browser

Public function Virtual

void

 

GetResourceSizeEx

(
    FResourceSizeEx& CumulativeResourc...
)

Get the size of the object/resource for use in memory tools or to display to artists/LDs in the Editor This is the extended version which separates up the used memory into different memory regions (the actual definition of which may be platform specific).

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent& PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Deprecated Variables

Name Description

Public variable

uint8: 1

 

bHDR_DEPRECATED

Whether to support storing HDR values, which requires more memory.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback