UTexture2D

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

uint32 : 1

 

bForceMiplevelsToBeResident

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

Public variable

uint32 : 1

 

bGlobalForceMipLevelsToBeResident

Global and serialized version of ForceMiplevelsToBeResident.

Public variable

uint32 : 1

 

bHasBeenPaintedInEditor

Whether the texture has been painted in the editor.

Public variable

uint32 : 1

 

bHasCancelationPending

Whether the current texture mip change request is pending cancellation.

Public variable

uint32 : 1

 

bHasStreamingUpdatePending

Whether some mips might be streamed soon.

Public variable

uint32 : 1

 

bIgnoreStreamingMipBias

Ignores the streaming mip bias used to accommodate memory constraints.

Public variable

uint32 : 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.

Public variable

FThreadSafeCoun ...

 

PendingMipChangeRequestStatus

Thread-safe counter indicating the texture streaming state.

Public variable

FTexturePlatfor ...

 

PlatformData

The derived data for this texture on this platform.

Public variable

int32

 

RequestedMips

Number of miplevels the texture should have resident.

Public variable

int32

 

ResidentMips

Number of miplevels currently resident.

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

 

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\AI\Navigation\ENGINE_API) v...

 

CancelPendingTextureStreaming()

Cancels any pending texture streaming actions if possible.

Public function Static

[ENGINE_API](API\Runtime\Engine\AI\Navigation\ENGINE_API) 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\AI\Navigation\ENGINE_API) 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

void

 

GetMipData

(
    int32 FirstMipToLoad,
    void** OutMipData
)

If WITH_EDITORONLY_DATA

Public function

int32

 

GetMipTailBaseIndex()

Public function

int32

 

GetNumMips()

Public function

int32

 

GetNumNonStreamingMips()

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

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\AI\Navigation\ENGINE_API) b...

 

GetSourceArtCRC

(
    uint32 & OutSourceCRC
)

Get the CRC of the source art pixels.

Public function

int32

 

GetStreamingIndex()

Public function

[ENGINE_API](API\Runtime\Engine\AI\Navigation\ENGINE_API) b...

 

HasAlphaChannel()

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

Public function

[ENGINE_API](API\Runtime\Engine\AI\Navigation\ENGINE_API) 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\AI\Navigation\ENGINE_API) 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\AI\Navigation\ENGINE_API) v...

 

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\AI\Navigation\ENGINE_API) v...

 

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.

Public function Virtual

void

 

WillNeverCacheCookedPlatformDataAgain()

All caching has finished for this object (all IsCachedCookedPlatformDataLoaded functions have finished for all platforms)

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