UTexture

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Engine/Texture.h

Include

#include "Engine/Texture.h"

Syntax

class UTexture :
    public UStreamableRenderAsset,
    public IInterface_AssetUserData,
    public IInterface_AsyncCompilation

Variables

Name Description

Public variable

float

 

AdjustBrightness

Static texture brightness adjustment (scales HSV value.) (Non-destructive; Requires texture source art to be available.)

Public variable

float

 

AdjustBrightnessCurve

Static texture curve adjustment (raises HSV value to the specified power.) (Non-destructive; Requires texture source art to be available.)

Public variable

float

 

AdjustHue

Static texture hue adjustment (0 - 360) (offsets HSV hue by value in degrees.) (Non-destructive; Requires texture source art to be available.)

Public variable

float

 

AdjustMaxAlpha

Remaps the alpha to the specified min/max range, defines the new value of 1 (Non-destructive; Requires texture source art to be available.)

Public variable

float

 

AdjustMinAlpha

Remaps the alpha to the specified min/max range, defines the new value of 0 (Non-destructive; Requires texture source art to be available.)

Public variable

float

 

AdjustRGBCurve

Static texture RGB curve adjustment (raises linear-space RGB color to the specified power.) (Non-destructive; Requires texture source art to be available.)

Public variable

float

 

AdjustSaturation

Static texture saturation adjustment (scales HSV saturation.) (Non-destructive; Requires texture source art to be available.)

Public variable

float

 

AdjustVibrance

Static texture "vibrance" adjustment (0 - 1) (HSV saturation algorithm adjustment.) (Non-destructive; Requires texture source art to be available.)

Public variable

FVector4

 

AlphaCoverageThresholds

Alpha values per channel to compare to when preserving alpha coverage.

Public variable

TObjectPtr< cla...

 

AssetImportData

Protected variable

TArray< TObject...

 

AssetUserData

Array of user data stored with the asset

Public variable

bool

 

bChromaKeyTexture

Whether to chroma key the image, replacing any pixels that match ChromaKeyColor with transparent black

Public variable

uint8: 1

 

bCustomPropertiesImported

Indicates ImportCustomProperties has been called (set in ImportCustomProperties, unset in the subsequent PostEditChange)

Public variable

bool

 

bDoScaleMipsForAlphaCoverage

Whether mip RGBA should be scaled to preserve the number of pixels with Value >= AlphaCoverageThresholds.

Public variable

uint32: 1

 

bFlipGreenChannel

When true the texture's green channel will be inverted. This is useful for some normal maps.

Public variable

uint8: 1

 

bIsImporting

Indicates we're currently importing the object (set in PostEditImport, unset in the subsequent PostEditChange)

Public variable

uint8: 1

 

bNormalizeNormals

Normalize colors in Normal Maps after mip generation for better and sharper quality; recommended on if not required to match legacy behavior.

Public variable

uint8: 1

 

bNoTiling

If true, the RHI texture will be created using TexCreate_NoTiling

Public variable

uint8: 1

 

bNotOfflineProcessed

If true, the RHI texture will be created without TexCreate_OfflineProcessed.

Public variable

uint32: 1

 

bPreserveBorder

When true the texture's border will be preserved during mipmap generation.

Public variable

uint8: 1

 

bUseLegacyGamma

A flag for using the simplified legacy gamma space e.g pow(color,1/2.2) for converting from FColor to FLinearColor, if we're doing sRGB.

Public variable

bool

 

bUseNewMipFilter

Use faster mip generation filter, usually the same result but occasionally causes color shift in high contrast areas.

Public variable

FColor

 

ChromaKeyColor

The color that will be replaced with transparent black if chroma keying is enabled

Public variable

float

 

ChromaKeyThreshold

The threshold that components have to match for the texel to be considered equal to the ChromaKeyColor when chroma keying (<=, set to 0 to require a perfect exact match)

Public variable

float

 

CompositePower

Default 1, high values result in a stronger effect e.g 1, 2, 4, 8 this is not a slider because the texture update would not be fast enough

Public variable

TObjectPtr< cla...

 

CompositeTexture

Can be defined to modify the roughness based on the normal map variation (mostly from mip maps).

Public variable

TEnumAsByte< en...

 

CompositeTextureMode

Defines how the CompositeTexture is applied, e.g. CTM_RoughnessFromNormalAlpha

Public variable

uint32: 1

 

CompressFinal

If enabled, compress with Final quality during this Editor session.

Public variable

FGuid

 

CompressionCacheId

Change this optional ID to force the texture to be recompressed by changing its cache key.

Public variable

uint32: 1

 

CompressionForceAlpha

If true, force alpha channel in output format when possible, eg. for AutoDXT BC1/BC3 choice

Public variable

uint32: 1

 

CompressionNoAlpha

If enabled, the texture's alpha channel will be forced to opaque for any compressed texture output format.

Public variable

uint32: 1

 

CompressionNone

If true, force the texture to be uncompressed no matter the format.

Public variable

TEnumAsByte< en...

 

CompressionQuality

The compression quality for generated ASTC textures (i.e. mobile platform textures).

Public variable

TEnumAsByte< en...

 

CompressionSettings

Compression settings to use when building the texture.

Public variable

uint8: 1

 

CompressionYCoCg

If true the texture stores YCoCg.

Public variable

TEnumAsByte< en...

 

CookPlatformTilingSettings

If the platform supports it, tile the texture when cooking, or keep it linear and tile it when it's actually submitted to the GPU.

Public variable

uint32: 1

 

DeferCompression

If enabled, defer compression of the texture until save or manually compressed in the texture editor.

Public variable

TMap< FString, ...

 

DidSerializeStreamingMipsForPlatform

Used to record texture streamable state when cooking.

Public variable

FPerPlatformFlo...

 

Downscale

Downscale source texture, applied only to 2d textures without mips 0.0 - use scale value from texture group 1.0 - do not scale texture

Public variable

ETextureDownsca...

 

DownscaleOptions

Texture downscaling options

Public variable

TEnumAsByte< en...

 

Filter

The texture filtering mode to use when sampling this texture.

Public variable

TArray< FTextur...

 

LayerFormatSettings

Array of settings used to control the format of given layer If this array doesn't include an entry for a given layer, values from UTexture will be used

Public variable

int32

 

LevelIndex

Level scope index of this texture.

Public variable

int

 

LoadedMainStreamObjectVersion

Store the FUE5MainStreamObjectVersion of the Texture uasset loaded for debugging (== LatestVersion if not loaded)

Public variable

int32

 

LODBias

A bias to the index of the top mip level to use.

Public variable

TEnumAsByte< en...

 

LODGroup

Texture group this texture belongs to

Public variable

TEnumAsByte< ET...

 

LossyCompressionAmount

How aggressively should any relevant lossy compression be applied.

Public variable

int32

 

MaxTextureSize

The maximum resolution for generated textures.

Public variable

TEnumAsByte< en...

 

MipGenSettings

Per asset specific setting to define the mip-map generation properties like sharpening and kernel size.

Public variable

ETextureMipLoad...

 

MipLoadOptions

The texture mip load options.

Public variable

FName

 

OodleTextureSdkVersion

Oodle Texture SDK Version to encode with.

Public variable

FColor

 

PaddingColor

The color used to pad the texture out if it is resized due to PowerOfTwoMode

Public variable

TEnumAsByte< en...

 

PowerOfTwoMode

How to pad the texture to a power of 2 size (if necessary)

Public variable

FRenderCommandF...

 

ReleaseFence

Release fence to know when resources have been freed on the rendering thread.

Public variable

FTextureSource

 

Source

Dynamic textures will have ! Source.IsValid()

Public variable

FTextureSourceC...

 

SourceColorSettings

Texture color management settings: source encoding and color space.

Public variable

uint8: 1

 

SRGB

Whether Texture and its source are in SRGB Gamma color space.

Public variable

TWeakPtr< class...

 

TextureEditorCustomEncoding

When we are open in an asset editor, we have a pointer to a custom encoding object which can optionally cause us to do something other than Fast/Final encode settings.

Public variable

FTextureReferen...

 

TextureReference

Stable RHI texture reference that refers to the current RHI texture.

Public variable

uint8: 1

 

VirtualTextureStreaming

Is this texture streamed in using VT

Constructors

Name Description

Public function

UTexture

(
    const FObjectInitializer& ObjectIn...
)

Public function

UTexture

(
    FVTableHelper& Helper
)

Destructors

Name Description

Public function Virtual

~UTexture()

Functions

Name Description

Public function Static

void

 

AppendToClassSchema

(
    FAppendToClassSchemaContext& Conte...
)

Public function

void

 

BeginCachePlatformData()

Begins caching platform data in the background.

Protected function

void

 

BeginFinalReleaseResource()

Public function Const

int64

 

Blueprint_GetMemorySize()

Gets the memory size of the texture, in bytes.

Public function Const

void

 

Blueprint_GetTextureSourceDiskAndMemorySize

(
    int64& OutDiskSize,
    int64& OutMemorySize
)

Gets the memory size of the texture source top mip, in bytes, and the size on disk of the asset, which may be compressed.

Public function

void

 

CachePlatformData

(
    bool bAsyncCache,
    bool bAllowAsyncBuild,
    bool bAllowAsyncLoading,
    ITextureCompressorModule* Comp...
)

Caches platform data for the texture.

Public function Virtual Const

uint32

 

CalcTextureMemorySizeEnum

(
    ETextureMipCount Enum
)

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

Public function Const

int32

 

CalculateLODBias

(
    bool bWithCinematicMipBias
)

Calculate the combined LOD bias based on texture LOD group and LOD bias.

Public function Static

void

 

CancelPendingTextureStreaming()

Cancels any pending texture streaming actions if possible.

Public function

void

 

CleanupCachedRunningPlatformData()

Public function Const

bool

 

ComputeTextureSourceChannelMinMax

(
    FLinearColor& OutColorMin,
    FLinearColor& OutColorMax
)

Scan the texture source pixels to compute the min & max values of the RGBA channels.

Public function Virtual

FTextureReso...

 

CreateResource()

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

Public function

void

 

FinishCachePlatformData()

Blocks on async cache tasks and prepares platform data for use.

Public function

void

 

ForceRebuildPlatformData

(
    uint8 InEncodeSpeedOverride
)

Forces platform data to be rebuilt.

Public function Static

bool

 

ForceUpdateTextureStreaming()

Forces textures to recompute LOD settings and stream as needed.

Public function Virtual

float

 

GetAverageBrightness

(
    bool bIgnoreTrueBlack,
    bool bUseGrayscale
)

Gets the average brightness of the texture (in linear space)

Public function Virtual

TMap< FStrin...

 

GetCookedPlatformData()

Public function Const

void

 

GetDefaultFormatSettings

(
    FTextureFormatSettings& OutSetting...
)

Public function Const

ETextureEnco...

 

GetDesiredEncodeSpeed()

Public function Virtual Const

FGuid

 

GetExternalTextureGuid()

Access the GUID which defines this texture's resources externally through FExternalTextureRegistry

Public function Const

EGammaSpace

 

GetGammaSpace()

Public function Const

void

 

GetLayerFormatSettings

(
    int32 LayerIndex,
    FTextureFormatSettings& OutSetting...
)

Gets settings used to choose format for the given layer

Public function Const

const FGuid ...

 

GetLightingGuid()

Returns a unique identifier for this texture. Used by the lighting build and texture streamer.

Public function Virtual Const

EMaterialVal...

 

GetMaterialType()

Public function Virtual Const

uint32

 

GetMaximumDimension()

Return maximum dimension for this texture type (2d/cube/vol) in the current RHI use GetMaximumDimensionOfNonVT for platform-independent max dim

Public function Static

int32

 

GetMaximumDimensionOfNonVT()

Get the largest allowed dimension of non-VT texture this is not for the current RHI (which may have a lower limit), this is for a Texture in general

Public function Static

TextureMipGe...

 

GetMipGenSettingsFromString

(
    const TCHAR* InStr,
    bool bTextureGroup
)

Public function Static

const TCHAR ...

 

GetMipGenSettingsString

(
    TextureMipGenSettings InEnum
)

Public function Static

UEnum *

 

GetPixelFormatEnum()

Retrieves the pixel format enum for enum <-> string conversions.

Public function Const

const FTextu...

 

GetResource()

Get the const texture's resource, can be NULL

Public function

FTextureReso...

 

GetResource()

Get the texture's resource, can be NULL

Protected function Const

FStreamableR...

 

GetResourcePostInitState

(
    const FTexturePlatformData* Pl...,
    bool bAllowStreaming,
    int32 MinRequestMipCount,
    int32 MaxMipCount,
    bool bSkipCanBeLoaded
)

Calculates the render resource initial state, expected to be used in InitResource() for derived classes implementing streaming.

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 Static

int32

 

GetStaticMinTextureResidentMipCount()

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

Public function Virtual Const

uint32

 

GetSurfaceArraySize()

Public function Virtual Const

float

 

GetSurfaceDepth()

Public function Virtual Const

float

 

GetSurfaceHeight()

Public function Virtual Const

float

 

GetSurfaceWidth()

Public function Virtual Const

TextureAddre...

 

GetTextureAddressX()

Public function Virtual Const

TextureAddre...

 

GetTextureAddressY()

Public function Virtual Const

TextureAddre...

 

GetTextureAddressZ()

Public function Virtual Const

ETextureClas...

 

GetTextureClass()

Get Texture Class

Public function Static

const TCHAR ...

 

GetTextureGroupString

(
    TextureGroup InGroup
)

Public function Virtual Const

void

 

GetVirtualTextureBuildSettings

(
    FVirtualTextureBuildSettings& OutS...
)

Returns the virtual texture build settings.

Public function Const

bool

 

HasHDRSource

(
    int32 LayerIndex
)

Checks whether this texture has a high dynamic range (HDR) source.

Public function Const

bool

 

IsAsyncCacheComplete()

Returns true if all async caching has completed.

Public function Const

bool

 

IsCandidateForTextureStreamingOnPlatformDuringCook

(
    const ITargetPlatform* InTarge...
)

Called by ULevel::MarkNoStreamableTexturesPrimitiveComponents when cooking level.

Public function Const

bool

 

IsCookPlatformTilingDisabled

(
    const ITargetPlatform* TargetP...
)

Checks whether this texture should be tiled to a platform-specific format during cook, or whether the bNotOfflineProcessed flag should be set to true at runtime because it has not been tiled at cook

Public function Virtual Const

bool

 

IsCurrentlyVirtualTextured()

Returns if the texture is actually being rendered using virtual texturing right now.

Public function Virtual Const

bool

 

IsDefaultTexture()

Returns true if the current texture is a default placeholder because compilation is still ongoing.

Public function Const

bool

 

IsNormalMap()

Public function Const

bool

 

IsPossibleToStream()

Do the Texture properties make it a possible candidate for streaming.

Public function Const

bool

 

IsUncompressed()

Public function

void

 

MarkPlatformDataTransient()

Marks platform data as transient.

Protected function

void

 

NotifyMaterials

(
    const ENotifyMaterialsEffectOnShade...
)

Notify any loaded material instances that the texture has changed.

Public function

void

 

ReleaseResource()

Resets the resource for the texture.

Public function

void

 

SerializeCookedPlatformData

(
    FArchive& Ar
)

Serializes cooked platform data.

Public function

void

 

SetDeterministicLightingGuid()

Generates a deterministic GUID for the texture based on the full name of the object.

Public function

void

 

SetLayerFormatSettings

(
    int32 LayerIndex,
    const FTextureFormatSettings& InSe...
)

Public function

void

 

SetLightingGuid

(
    const FGuid& Guid
)

Public function

void

 

SetLightingGuid()

Assigns a new GUID to a texture.

Public function Static

void

 

SetMinTextureResidentMipCount

(
    int32 InMinTextureResidentMipCount
)

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

Public function

void

 

SetResource

(
    FTextureResource* Resource
)

Set texture's resource, can be NULL

Protected function

bool

 

TryCancelCachePlatformData()

Try to cancel any async tasks on PlatformData.

Public function Virtual

void

 

UpdateOodleTextureSdkVersionToLatest()

Change the Oodle Texture Sdk Version used to encode this texture to latest.

Public function Virtual

void

 

UpdateResource()

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

Public function Virtual

void

 

ValidateSettingsAfterImportOrEdit

(
    bool* pRequiresNotifyMaterials
)

Ensure settings are valid after import or edit; this is called by PostEditChange.

Overridden from UStreamableRenderAsset

Name Description

Public function Virtual Const

bool

 

DoesMipDataExist

(
    const int32 MipIndex
)

Public function Virtual Const

int32

 

GetCachedLODBias()

Returns the combined LOD bias based on texture LOD group and LOD bias.

Public function Virtual Const

float

 

GetLastRenderTimeForStreaming()

Get the per-asset last render time.

Public function Virtual Const

int32

 

GetLODGroupForStreaming()

Get an integer representation of the LOD group

Public function Virtual Const

FIoFilenameH...

 

GetMipIoFilenameHash

(
    const int32 MipIndex
)

Public function Virtual Const

EStreamableR...

 

GetRenderAssetType()

Public function Virtual Const

bool

 

HasPendingLODTransition()

Public function Virtual Const

bool

 

HasPendingRenderResourceInitialization()

Also returns false if the render resource is non existent, to prevent stalling on an event that will never complete.

Public function Virtual

void

 

InvalidateLastRenderTimeForStreaming()

Invalidates per-asset last render time.

Public function Virtual Const

bool

 

ShouldMipLevelsBeForcedResident()

Returns whether miplevels should be forced resident.

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginCacheForCookedPlatformData

(
    const ITargetPlatform* TargetP...
)

Begins caching platform data in the background for the platform requested

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual Const

bool

 

CanEditChange

(
    const FProperty* InProperty
)

Called by the editor to query whether a property of this object is allowed to be modified.

Public function Virtual

void

 

ClearAllCachedCookedPlatformData()

Clear all cached cooked platform data

Public function Virtual

void

 

ClearCachedCookedPlatformData

(
    const ITargetPlatform* TargetP...
)

Clears cached cooked platform data for specific platform

Public function Virtual

void

 

ExportCustomProperties

(
    FOutputDevice& Out,
    uint32 Indent
)

Exports the property values for the specified object as text to the output device.

Public function Virtual

void

 

FinishDestroy()

Called to finish destroying the object.

Public function Virtual Const

void

 

GetAssetRegistryTags

(
    TArray< FAssetRegistryTag >& OutTa...
)

Gathers a list of asset registry searchable tags which are name/value pairs with some type information This only needs to be implemented for asset objects

Public function Virtual

void

 

ImportCustomProperties

(
    const TCHAR* SourceText,
    FFeedbackContext* Warn
)

Exports the property values for the specified object as text to the output device.

Public function Virtual

bool

 

IsCachedCookedPlatformDataLoaded

(
    const ITargetPlatform* TargetP...
)

Have we finished loading all the cooked platform data for the target platforms requested in BeginCacheForCookedPlatformData

Public function Virtual Const

bool

 

IsPostLoadThreadSafe()

Called during async load to determine if PostLoad can be called on the loading thread.

Public function Virtual

bool

 

IsReadyForFinishDestroy()

Called to check if the object is ready for FinishDestroy.

Public function Virtual

bool

 

Modify

(
    bool bAlwaysMarkDirty
)

Note that the object will be modified.

Public function Virtual

void

 

PostCDOContruct()

Called after the C++ constructor has run on the Class Default Object (CDO) for a class.

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent& PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostEditImport()

Called after importing property values for this object (paste, duplicate or .t3d import) Allow the object to perform any cleanup for properties which shouldn't be duplicated or are unsupported by the script serialization

Public function Virtual

void

 

PostInitProperties()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

Public function Virtual

void

 

PostLoad()

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

Public function Virtual

void

 

PreSave

(
    FObjectPreSaveContext SaveContext
)

Presave function.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Overridden from IInterface_AssetUserData

Name Description

Public function Virtual

void

 

AddAssetUserData

(
    UAssetUserData* InUserData
)

Public function Virtual Const

const TArray...

 

GetAssetUserDataArray()

Public function Virtual

UAssetUserDa...

 

GetAssetUserDataOfClass

(
    TSubclassOf< UAssetUserData > InUse...
)

Public function Virtual

void

 

RemoveUserDataOfClass

(
    TSubclassOf< UAssetUserData > InUse...
)

Overridden from IInterface_AsyncCompilation

Name Description

Public function Virtual Const

bool

 

IsCompiling()

Returns whether or not the asset is currently being compiled

Enums

Typedefs

Name

Description

FOnTextureSaved

Delegate type for texture save events ( Params: UTexture* TextureToSave )

Constants

Name

Description

GMinTextureResidentMipCount

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

PreSaveEvent

Triggered before a texture is being saved

Deprecated Variables

Name Description

Public variable

uint32: 1

 

bDitherMipMapAlpha_DEPRECATED

Removed.

Public variable

TFieldPtrAccess...

 

Resource

Use GetResource() / SetResource() accessors instead.

Public variable

FString

 

SourceFilePath_DEPRECATED

Deprecated Functions

Name Description

Public function Const

int64

 

GetBuildRequiredMemory()

Use GetBuildRequiredMemoryEstimate instead

Public function Virtual

PRAGMA_DISAB...

 

PreSave

(
    const ITargetPlatform* TargetP...
)

Use version that takes FObjectPreSaveContext instead.

Public function

void

 

UpdateCachedLODBias()

UpdateCachedLODBias does nothing, remove call

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Cancel