UTexture

Windows
MacOS
Linux

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

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

UAssetImportDat...

 

AssetImportData

Protected variable

TArray< UAssetU...

 

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

uint32: 1

 

bDitherMipMapAlpha

When true, the alpha channel of mip-maps and the base image are dithered for smooth LOD transitions.

Public variable

uint32: 1

 

bFlipGreenChannel

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

Public variable

uint32: 1

 

bForcePVRTC4

For DXT1 textures, setting this will cause the texture to be twice the size, but better looking, on iPhone

Public variable

uint8: 1

 

bNoTiling

If true, the RHI texture will be created using TexCreate_NoTiling

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

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 no slider because the texture update would not be fast enough

Public variable

UTexture *

 

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

 

CompressionNoAlpha

If enabled, the texture's alpha channel will be discarded during compression

Public variable

uint32: 1

 

CompressionNone

Public variable

TEnumAsByte< en...

 

CompressionQuality

The compression quality for generated textures.

Public variable

TEnumAsByte< en...

 

CompressionSettings

Compression settings to use when building the texture.

Public variable

uint32: 1

 

DeferCompression

If enabled, defer compression of the texture until save.

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

 

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

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

FTextureResourc...

 

Resource

The texture's resource, can be NULL

Public variable

FTextureSource

 

Source

Public variable

uint8: 1

 

SRGB

This should be unchecked if using alpha channels individually as masks.

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...
)

Functions

Name Description

Public function

void

 

BeginCachePlatformData()

Begins caching platform data in the background.

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

void

 

CleanupCachedRunningPlatformData()

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()

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 Virtual Const

FGuid

 

GetExternalTextureGuid()

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

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.

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 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 Const

float

 

GetSurfaceHeight()

Public function Virtual Const

float

 

GetSurfaceWidth()

Public function Static

const TCHAR ...

 

GetTextureGroupString

(
    TextureGroup InGroup
)

Public function Const

bool

 

HasHDRSource

(
    int32 LayerIndex
)

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

Public function

bool

 

IsAsyncCacheComplete()

Returns true if all async caching has completed.

Public function Virtual Const

bool

 

IsCurrentlyVirtualTextured()

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

Public function Const

bool

 

IsNormalMap()

Public function

void

 

MarkPlatformDataTransient()

Marks platform data as transient.

Protected function

void

 

NotifyMaterials()

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

 

SetLayerFormatSettings

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

Public function

void

 

SetLightingGuid()

Assigns a new GUID to a texture.

Public function

void

 

UpdateCachedLODBias()

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

Public function Virtual

void

 

UpdateResource()

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

Public function Virtual

void

 

WaitForStreaming()

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

Overridden from UStreamableRenderAsset

Name Description

Public function Virtual Const

int32

 

GetLODGroupForStreaming()

Get an integer representation of the LOD group

Public function Virtual Const

bool

 

HasPendingUpdate()

Public function Virtual

bool

 

UpdateStreamingStatus

(
    bool bWaitForMipFading
)

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

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 UProperty* 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

 

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

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

void

 

PostCDOContruct()

Called after the C++ constructor has run on the 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

 

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

(
    const ITargetPlatform* TargetP...
)

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...
)

Typedefs

Name

Description

FOnTextureSaved

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

Constants

Name

Description

PreSaveEvent

Triggered before a texture is being saved

Deprecated Variables

Name Description

Public variable

FString

 

SourceFilePath_DEPRECATED

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