Language:
Discover
By Skill Level
By Category

UTexture2D

Choose your OS:

Inheritance Hierarchy

Syntax

class UTexture2D : public UTexture

Variables

Name Description

Public variable

TEnumAsByte < en...

 

AddressX

WITH_EDITORONLY_DATA.

Public variable

TEnumAsByte < en...

 

AddressY

The addressing mode to use for the Y axis.

Public variable

uint8 : 1

 

bForceMiplevelsToBeResident

Override whether to fully stream even if texture hasn't been rendered.

Public variable

uint8 : 1

 

bGlobalForceMipLevelsToBeResident

Global and serialized version of ForceMiplevelsToBeResident.

Public variable

uint8 : 1

 

bHasBeenPaintedInEditor

Whether the texture has been painted in the editor.

Public variable

uint8 : 1

 

bHasStreamingUpdatePending

Whether some mips might be streamed soon.

Public variable

uint8 : 1

 

bIgnoreStreamingMipBias

Ignores the streaming mip bias used to accommodate memory constraints.

Public variable

uint8 : 1

 

bIsStreamable

Whether the texture is currently streamable or not.

Public variable

TMap < FString , ...

 

CookedPlatformData

Cooked platform data for this texture

Public variable

int32

 

FirstResourceMemMip

Keep track of first mip level used for ResourceMem creation

Public variable

int32

 

LevelIndex

Level scope index of this texture.

Protected variable

FTexture2DUpdat...

 

PendingUpdate

Helper to manage the current pending update following a call to StreamIn() or StreamOut() .

Public variable

FTexturePlatfor ...

 

PlatformData

The derived data for this texture on this platform.

Public variable

FTexture2DResou ...

 

ResourceMem

Memory used for directly loading bulk mip data

Constructors

Name Description

Public function

UTexture2D

(
    const FObjectInitializer & ObjectIn...
)

============================================================================= Texture2D.cpp: Implementation of UTexture2D .

Functions

Name Description

Public function

int32

 

Blueprint_GetSizeX()

Gets the X size of the texture, in pixels

Public function

int32

 

Blueprint_GetSizeY()

Gets the Y size of the texture, in pixels

Public function Static

void

 

CalcAllowedMips

(
    int32 MipCount,
    int32 NumNonStreamingMips,
    int32 LODBias,
    int32 & OuMinAllowedMips,
    int32 & OutMaxAllowedMips
)

Computes the minimum and maximum allowed mips for a texture.

Public function

int32

 

CalcNumOptionalMips()

Public function

int32

 

CalcTextureMemorySize

(
    int32 MipCount
)

Calculates the size of this texture in bytes if it had MipCount miplevels streamed in.

Public function

bool

 

CancelPendingMipChangeRequest()

Tries to cancel a pending mip change request.

Public function Static

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3)vo...

 

CancelPendingTextureStreaming()

Cancels any pending texture streaming actions if possible.

Public function Static

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3) c...

 

CreateTransient

(
    int32 InSizeX,
    int32 InSizeY,
    EPixelFormat InFormat
)

Creates and initializes a new Texture2D with the requested settings

Public function Static

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3) f...

 

GetGlobalMipMapLODBias()

Returns the global mip map bias applied as an offset for 2d textures.

Public function

FIntPoint

 

GetImportedSize()

Retrieves the size of the source image from which the texture was created.

Public function

float

 

GetLastRenderTimeForStreaming()

Retrieves the last render time used for streaming.

Public function Static

int32

 

GetMinTextureResidentMipCount()

Returns the minimum number of mips that must be resident in memory (cannot be streamed).

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3)vo...

 

GetMipData

(
    int32 FirstMipToLoad,
    void** OutMipData
)

Get mip data starting with the specified mip index. Texture derived data interface.

Public function

bool

 

GetMipDataFilename

(
    const int32 MipIndex,
    const FString *& BulkDataFilena...
)

Public function

int32

 

GetMipTailBaseIndex()

Public function

int32

 

GetNumMips()

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3)in ...

 

GetNumMipsAllowed

(
    bool bIgnoreMinResidency
)

Calculates the maximum number of mips the engine allows to be loaded for this texture.

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3)in ...

 

GetNumNonStreamingMips()

Returns the number of mips in this texture that are not able to be streamed.

Public function

int32

 

GetNumRequestedMips()

When the texture is being updated from StreamIn() or StreamOut() , returns the number of mips requested.

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3)in ...

 

GetNumResidentMips()

The number of mips currently in memory.

Public function

EPixelFormat

 

GetPixelFormat()

Public function

const TIndir ...

 

GetPlatformMips()

Public function

bool

 

GetResourceMemSettings

(
    int32 FirstMipIdx,
    int32 & OutSizeX,
    int32 & OutSizeY,
    int32 & OutNumMips,
    uint32 & OutTexCreateFlags
)

#if WITH_EDITORONLY_DATA

Public function

int32

 

GetSizeX()

Trivial accessors.

Public function

int32

 

GetSizeY()

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3) b...

 

GetSourceArtCRC

(
    uint32 & OutSourceCRC
)

Get the CRC of the source art pixels.

Public function

int32

 

GetStreamingIndex()

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3) b...

 

HasAlphaChannel()

Returns true if the runtime texture has an alpha channel that is not completely white.

Public function

bool

 

HasPendingUpdate()

True if the texture is currently being updated through StreamIn() or StreamOut() .

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3) b...

 

HasSameSourceArt

(
    UTexture2D * InTexture
)

See if the source art of the two textures matches...

bool true if they matche, false if not

Public function

void

 

InvalidateLastRenderTimeForStreaming()

Invalidates the last render time used for streaming.

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3) b...

 

IsFullyStreamedIn()

Whether all miplevels of this texture have been fully streamed in, LOD settings permitting.

Public function

bool

 

IsReadyForStreaming()

Returns whether the texture is ready for streaming aka whether it has had InitRHI called on it.

Public function

void

 

LinkStreaming()

Links texture to the texture streaming manager.

Public function Virtual

void

 

RefreshSamplerStates()

Update the offset for mip map lod bias. This is added to any existing mip bias values.

Public function Virtual

void

 

SetForceMipLevelsToBeResident

(
    float Seconds,
    int32 CinematicTextureGroups
)

Tells the streaming system that it should force all mip-levels to be resident for a number of seconds.

Public function Static

void

 

SetMinTextureResidentMipCount

(
    int32 InMinTextureResidentMipCount
)

Sets the minimum number of mips that must be resident in memory (cannot be streamed).

Public function

bool

 

ShouldMipLevelsBeForcedResident()

Returns whether miplevels should be forced resident.

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3) b...

 

StreamIn

(
    int32 NewMipCount,
    bool bHighPrio
)

Loads mips from disk to memory.

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3) b...

 

StreamOut

(
    int32 NewMipCount
)

Unload some mips from memory.

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3)vo...

 

TemporarilyDisableStreaming()

Temporarily disable streaming so we update subregions of this texture without streaming clobbering it.

Public function

void

 

UnlinkStreaming()

Unlinks texture from the texture streaming manager.

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3)vo...

 

UpdateTextureRegions

(
    int32 MipIndex,
    uint32 NumRegions,
    const FUpdateTextureRegion2D * ...,
    uint32 SrcPitch,
    uint32 SrcBpp,
    uint8 * SrcData,
    TFunction < void(uint8 *SrcData,...
)

Asynchronously update a set of regions of a texture with new data.

Overridden from UTexture

Name Description

Public function Virtual

uint32

 

CalcTextureMemorySizeEnum

(
    ETextureMipCount Enum
)

Calculates the size of this texture if it had MipCount miplevels streamed in.

Public function Virtual

FTextureReso ...

 

CreateResource()

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

Public function Virtual

float

 

GetAverageBrightness

(
    bool bIgnoreTrueBlack,
    bool bUseGrayscale
)

WITH_EDITOR.

Public function Virtual

TMap < FStrin ...

 

GetCookedPlatformData()

Public function Virtual

EMaterialVal ...

 

GetMaterialType()

The material value type of this texture.

Public function Virtual

FTexturePlat ...

 

GetRunningPlatformData()

Textures that use the derived data cache must override this function and provide a pointer to the linked list of platform data.

Public function Virtual

float

 

GetSurfaceHeight()

The height of the surface represented by the texture.

Public function Virtual

float

 

GetSurfaceWidth()

The width of the surface represented by the texture.

Public function Virtual

void

 

UpdateResource()

Creates a new resource for the texture, and updates any cached references to the resource.

Public function Virtual

bool

 

UpdateStreamingStatus

(
    bool bWaitForMipFading
)

Updates the streaming status of the texture and performs finalization when appropriate.

Public function Virtual

void

 

WaitForStreaming()

Waits until all streaming requests for this texture has been fully processed.

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

WITH_EDITOR.

Public function Virtual

void

 

GetAssetRegistryTags

(
    TArray < FAssetRegistryTag >& OutTa...
)

Public function Virtual

FString

 

GetDesc()

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

Public function Virtual

void

 

GetResourceSizeEx

(
    FResourceSizeEx & CumulativeResourc...
)

Returns the size of the object/ resource for display to artists/ LDs in the Editor.

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent & PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostEditUndo()

Called after an editor or undo operation is formed on texture

Public function Virtual

void

 

PostLinkerChange()

Called in response to the linker changing, this can only happen in the editor

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object, and immediately after any undo/redo.

Public function Virtual

void

 

PreSave

(
    const ITargetPlatform * TargetP...
)

Presave function.

Public function Virtual

void

 

Serialize

(
    FArchive & Ar
)

WITH_EDITOR.

Constants

Name

Description

GMinTextureResidentMipCount

The minimum number of mips that must be resident in memory (cannot be streamed).

References

Module

Engine

Header

Runtime/Engine/Classes/Engine/Texture2D.h