Navigation
Unreal Engine C++ API Reference > Runtime > Engine > Engine
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UStreamableRenderAsset
- UTexture
- UARTexture
- UAppleARKitOcclusionTexture
- UARTextureCameraDepth
- UAppleARKitTextureCameraDepth
- UARTextureCameraImage
- UAppleARKitCameraVideoTexture
- UAppleARKitTextureCameraImage
- UBinkMediaTexture
- UMediaTexture
- UTexture2D
- UCurveLinearColorAtlas
- ULightMapTexture2D
- ULightMapVirtualTexture2D
- URuntimeVirtualTextureStreamingProxy
- UShadowMapTexture2D
- UTextureLightProfile
- UVirtualTexture2D
- UTexture2DArray
- UTexture2DDynamic
- UTextureCube
- UAREnvironmentCaptureProbeTexture
- UAppleARKitEnvironmentCaptureProbeTexture
- UTextureCubeArray
- UTextureRenderTarget
- UTextureRenderTarget2D
- UCanvasRenderTarget2D
- UTextureRenderTarget2DArray
- UTextureRenderTargetCube
- UTextureRenderTargetVolume
- UVolumeTexture
- UWebBrowserTexture
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
Type | Name | Description | |
---|---|---|---|
float | AdjustBrightness | Static texture brightness adjustment (scales HSV value.) (Non-destructive; Requires texture source art to be available.) | |
float | AdjustBrightnessCurve | Static texture curve adjustment (raises HSV value to the specified power.) (Non-destructive; Requires texture source art to be available.) | |
float | AdjustHue | Static texture hue adjustment (0 - 360) (offsets HSV hue by value in degrees.) (Non-destructive; Requires texture source art to be available.) | |
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.) | |
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.) | |
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.) | |
float | AdjustSaturation | Static texture saturation adjustment (scales HSV saturation.) (Non-destructive; Requires texture source art to be available.) | |
float | AdjustVibrance | Static texture "vibrance" adjustment (0 - 1) (HSV saturation algorithm adjustment.) (Non-destructive; Requires texture source art to be available.) | |
FVector4 | AlphaCoverageThresholds | Alpha values per channel to compare to when preserving alpha coverage. | |
TObjectPtr< class UAssetImportData > | AssetImportData | ||
TArray< TObjectPtr< UAssetUserData > > | AssetUserData | Array of user data stored with the asset | |
bool | bChromaKeyTexture | Whether to chroma key the image, replacing any pixels that match ChromaKeyColor with transparent black | |
uint8: 1 | bCustomPropertiesImported | Indicates ImportCustomProperties has been called (set in ImportCustomProperties, unset in the subsequent PostEditChange) | |
bool | bDoScaleMipsForAlphaCoverage | Whether mip RGBA should be scaled to preserve the number of pixels with Value >= AlphaCoverageThresholds. | |
uint32: 1 | bFlipGreenChannel | When true the texture's green channel will be inverted. This is useful for some normal maps. | |
uint8: 1 | bIsImporting | Indicates we're currently importing the object (set in PostEditImport, unset in the subsequent PostEditChange) | |
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. | |
uint8: 1 | bNoTiling | If true, the RHI texture will be created using TexCreate_NoTiling | |
uint8: 1 | bNotOfflineProcessed | If true, the RHI texture will be created without TexCreate_OfflineProcessed. | |
uint32: 1 | bPreserveBorder | When true the texture's border will be preserved during mipmap generation. | |
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. | |
bool | bUseNewMipFilter | Use faster mip generation filter, usually the same result but occasionally causes color shift in high contrast areas. | |
FColor | ChromaKeyColor | The color that will be replaced with transparent black if chroma keying is enabled | |
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) | |
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 | |
TEnumAsByte< enum ECompositeTextureMode > | CompositeTextureMode | Defines how the CompositeTexture is applied, e.g. CTM_RoughnessFromNormalAlpha | |
uint32: 1 | CompressFinal | If enabled, compress with Final quality during this Editor session. | |
FGuid | CompressionCacheId | Change this optional ID to force the texture to be recompressed by changing its cache key. | |
uint32: 1 | CompressionForceAlpha | If true, force alpha channel in output format when possible, eg. for AutoDXT BC1/BC3 choice | |
uint32: 1 | CompressionNoAlpha | If enabled, the texture's alpha channel will be forced to opaque for any compressed texture output format. | |
uint32: 1 | CompressionNone | If true, force the texture to be uncompressed no matter the format. | |
TEnumAsByte< enum ETextureCompressionQuality > | CompressionQuality | The compression quality for generated ASTC textures (i.e. mobile platform textures). | |
TEnumAsByte< enum TextureCompressionSettings > | CompressionSettings | Compression settings to use when building the texture. | |
uint8: 1 | CompressionYCoCg | If true the texture stores YCoCg. | |
TEnumAsByte< enum TextureCookPlatformTilingSettings > | 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. | |
uint32: 1 | DeferCompression | If enabled, defer compression of the texture until save or manually compressed in the texture editor. | |
TMap< FString, bool > | DidSerializeStreamingMipsForPlatform | Used to record texture streamable state when cooking. | |
FPerPlatformFloat | 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 | |
ETextureDownscaleOptions | DownscaleOptions | Texture downscaling options | |
TEnumAsByte< enum TextureFilter > | Filter | The texture filtering mode to use when sampling this texture. | |
TArray< FTextureFormatSettings > | 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 | |
int32 | LevelIndex | Level scope index of this texture. | |
int | LoadedMainStreamObjectVersion | Store the FUE5MainStreamObjectVersion of the Texture uasset loaded for debugging (== LatestVersion if not loaded) | |
int32 | LODBias | A bias to the index of the top mip level to use. | |
TEnumAsByte< enum TextureGroup > | LODGroup | Texture group this texture belongs to | |
TEnumAsByte< ETextureLossyCompressionAmount > | LossyCompressionAmount | How aggressively should any relevant lossy compression be applied. | |
int32 | MaxTextureSize | The maximum resolution for generated textures. | |
TEnumAsByte< enum TextureMipGenSettings > | MipGenSettings | Per asset specific setting to define the mip-map generation properties like sharpening and kernel size. | |
ETextureMipLoadOptions | MipLoadOptions | The texture mip load options. | |
FName | OodleTextureSdkVersion | Oodle Texture SDK Version to encode with. | |
FColor | PaddingColor | The color used to pad the texture out if it is resized due to PowerOfTwoMode | |
TEnumAsByte< enum ETexturePowerOfTwoSetting::Type > | PowerOfTwoMode | How to pad the texture to a power of 2 size (if necessary) | |
FRenderCommandFence | ReleaseFence | Release fence to know when resources have been freed on the rendering thread. | |
FTextureSource | Source | Dynamic textures will have ! Source.IsValid() ; Also in UEFN , Textures from the cooked-only texture library. | |
FTextureSourceColorSettings | SourceColorSettings | Texture color management settings: source encoding and color space. | |
uint8: 1 | SRGB | Whether Texture and its source are in SRGB Gamma color space. | |
TWeakPtr< class FTextureEditorCustomEncode > | 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. | |
FTextureReference & | TextureReference | Stable RHI texture reference that refers to the current RHI texture. | |
uint8: 1 | VirtualTextureStreaming | Is this texture streamed in using VT |
Constructors
Type | Name | Description | |
---|---|---|---|
UTexture
(
const FObjectInitializer& ObjectInitializer |
|||
UTexture
(
FVTableHelper& Helper |
Destructors
Type | Name | Description | |
---|---|---|---|
~UTexture () |
Functions
Type | Name | Description | |
---|---|---|---|
void | AppendToClassSchema
(
FAppendToClassSchemaContext& Context |
||
void | Begins caching platform data in the background. | ||
void | |||
int64 | Gets the memory size of the texture, in bytes. | ||
void | Blueprint_GetTextureSourceDiskAndMemorySize
(
int64& OutDiskSize, |
Gets the memory size of the texture source top mip, in bytes, and the size on disk of the asset, which may be compressed. | |
void | CachePlatformData
(
bool bAsyncCache, |
Caches platform data for the texture. | |
uint32 | CalcTextureMemorySizeEnum
(
ETextureMipCount Enum |
Calculates the size of this texture if it had MipCount miplevels streamed in. | |
int32 | CalculateLODBias
(
bool bWithCinematicMipBias |
Calculate the combined LOD bias based on texture LOD group and LOD bias. | |
void | Cancels any pending texture streaming actions if possible. | ||
void | |||
bool | ComputeTextureSourceChannelMinMax
(
FLinearColor& OutColorMin, |
Scan the texture source pixels to compute the min & max values of the RGBA channels. | |
FTextureResource * | Implemented by subclasses to create a new resource for the texture. | ||
bool | DownsizeImageUsingTextureSettings
(
const ITargetPlatform* TargetPlatform, |
Downsize the 2D Image with the build setting of the texture. | |
void | Blocks on async cache tasks and prepares platform data for use. | ||
void | ForceRebuildPlatformData
(
uint8 InEncodeSpeedOverride |
Forces platform data to be rebuilt. | |
bool | Forces textures to recompute LOD settings and stream as needed. | ||
float | GetAverageBrightness
(
bool bIgnoreTrueBlack, |
Gets the average brightness of the texture (in linear space) | |
void | GetBuiltTextureSize
(
const ITargetPlatform* TargetPlatform, |
Get the dimensions of the largest mip of the texture when built for the target platform accounting for LODBias and other constraints | |
UTexture * | |||
TMap< FString, FTexturePlatformData * > * | |||
void | GetDefaultFormatSettings
(
FTextureFormatSettings& OutSettings |
||
ETextureEncodeSpeed | |||
FGuid | Access the GUID which defines this texture's resources externally through FExternalTextureRegistry | ||
EGammaSpace | |||
void | GetLayerFormatSettings
(
int32 LayerIndex, |
Gets settings used to choose format for the given layer | |
const FGuid & | Returns a unique identifier for this texture. Used by the lighting build and texture streamer. | ||
EMaterialValueType | |||
uint32 | Return maximum dimension for this texture type (2d/cube/vol) in the current RHI use GetMaximumDimensionOfNonVT for platform-independent max dim | ||
int32 | 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 | ||
TextureMipGenSettings | GetMipGenSettingsFromString
(
const TCHAR* InStr, |
||
const TCHAR * | GetMipGenSettingsString
(
TextureMipGenSettings InEnum |
||
UEnum * | Retrieves the pixel format enum for enum <-> string conversions. | ||
void | GetPlatformTextureFormatNamesWithPrefix
(
const ITargetPlatform* TargetPlatform, |
Get TextureFormatName with platform remaps and conditional prefix this is the entry point API for getting the final texture format name OutFormats will be resized to the number of sub-flavors of the platform (typically just 1) OutFormats[i] gets an array of format names, one per layer | |
const FTextureResource * | GetResource () |
Get the const texture's resource, can be NULL | |
FTextureResource * | GetResource () |
Get the texture's resource, can be NULL | |
FStreamableRenderResourceState | GetResourcePostInitState
(
const FTexturePlatformData* PlatformData, |
Calculates the render resource initial state, expected to be used in InitResource() for derived classes implementing streaming. | |
FTexturePlatformData ** | Textures that use the derived data cache must override this function and provide a pointer to the linked list of platform data. | ||
int32 | Returns the minimum number of mips that must be resident in memory (cannot be streamed). | ||
uint32 | |||
float | |||
float | |||
float | |||
TextureAddress | |||
TextureAddress | |||
TextureAddress | |||
ETextureClass | Get Texture Class | ||
const TCHAR * | GetTextureGroupString
(
TextureGroup InGroup |
||
void | GetVirtualTextureBuildSettings
(
FVirtualTextureBuildSettings& OutSettings |
Returns the virtual texture build settings. | |
bool | HasHDRSource
(
int32 LayerIndex |
Checks whether this texture has a high dynamic range (HDR) source. | |
bool | Returns true if all async caching has completed. | ||
bool | IsCandidateForTextureStreamingOnPlatformDuringCook
(
const ITargetPlatform* InTargetPlatform |
Called by ULevel::MarkNoStreamableTexturesPrimitiveComponents when cooking level. | |
bool | IsCookPlatformTilingDisabled
(
const ITargetPlatform* TargetPlatform |
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 | |
bool | Returns if the texture is actually being rendered using virtual texturing right now. | ||
bool | Returns true if the current texture is a default placeholder because compilation is still ongoing. | ||
bool | IsNormalMap () |
||
bool | Do the Texture properties make it a possible candidate for streaming. | ||
bool | |||
void | Marks platform data as transient. | ||
void | NotifyMaterials
(
const ENotifyMaterialsEffectOnShaders EffectOnShaders |
Notify any loaded material instances that the texture has changed. | |
void | Resets the resource for the texture. | ||
void | SerializeCookedPlatformData
(
FArchive& Ar, |
Serializes cooked platform data. | |
void | SetCompositeTexture
(
UTexture* InCompositeTexture |
||
void | Generates a deterministic GUID for the texture based on the full name of the object. | ||
void | SetLayerFormatSettings
(
int32 LayerIndex, |
||
void | SetLightingGuid
(
const FGuid& Guid |
||
void | Assigns a new GUID to a texture. | ||
void | SetMinTextureResidentMipCount
(
int32 InMinTextureResidentMipCount |
Sets the minimum number of mips that must be resident in memory (cannot be streamed). | |
void | SetResource
(
FTextureResource* Resource |
Set texture's resource, can be NULL | |
bool | Try to cancel any async tasks on PlatformData. | ||
void | UpdateOodleTextureSdkVersionToLatest
(
bool bDoPrePostEditChangeIfChanging |
Change the Oodle Texture Sdk Version used to encode this texture to latest. | |
void | Creates a new resource for the texture, and updates any cached references to the resource. | ||
void | ValidateSettingsAfterImportOrEdit
(
bool* pRequiresNotifyMaterials |
Ensure settings are valid after import or edit; this is called by PostEditChange. |
Overridden from UStreamableRenderAsset
Type | Name | Description | |
---|---|---|---|
bool | DoesMipDataExist
(
const int32 MipIndex |
||
int32 | Returns the combined LOD bias based on texture LOD group and LOD bias. | ||
float | Get the per-asset last render time. | ||
int32 | Get an integer representation of the LOD group | ||
FIoFilenameHash | GetMipIoFilenameHash
(
const int32 MipIndex |
||
EStreamableRenderAssetType | |||
bool | |||
bool | Also returns false if the render resource is non existent, to prevent stalling on an event that will never complete. | ||
void | Invalidates per-asset last render time. | ||
bool | Returns whether miplevels should be forced resident. |
Overridden from UObject
Type | Name | Description | |
---|---|---|---|
void | BeginCacheForCookedPlatformData
(
const ITargetPlatform* TargetPlatform |
Begins caching platform data in the background for the platform requested | |
void | BeginDestroy () |
Called before destroying the object. | |
bool | CanEditChange
(
const FProperty* InProperty |
Called by the editor to query whether a property of this object is allowed to be modified. | |
void | Clear all cached cooked platform data | ||
void | ClearCachedCookedPlatformData
(
const ITargetPlatform* TargetPlatform |
Clears cached cooked platform data for specific platform | |
void | ExportCustomProperties
(
FOutputDevice& Out, |
Exports the property values for the specified object as text to the output device. | |
void | Called to finish destroying the object. | ||
void | GetAssetRegistryTags
(
TArray< FAssetRegistryTag >& OutTags |
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 | |
void | ImportCustomProperties
(
const TCHAR* SourceText, |
Exports the property values for the specified object as text to the output device. | |
bool | IsCachedCookedPlatformDataLoaded
(
const ITargetPlatform* TargetPlatform |
Have we finished loading all the cooked platform data for the target platforms requested in BeginCacheForCookedPlatformData | |
bool | Called during async load to determine if PostLoad can be called on the loading thread. | ||
bool | Called to check if the object is ready for FinishDestroy. | ||
bool | Modify
(
bool bAlwaysMarkDirty |
Note that the object will be modified. | |
void | Called after the C++ constructor has run on the Class Default Object (CDO) for a class. | ||
void | PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Called when a property on this object has been modified externally | |
void | 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 | ||
void | Called after the C++ constructor and after the properties have been initialized, including those loaded from config. | ||
void | PostLoad () |
Do any object-specific cleanup required immediately after loading an object. | |
void | PreSave
(
FObjectPreSaveContext SaveContext |
Presave function. | |
void | Handles reading, writing, and reference collecting using FArchive. |
Overridden from IInterface_AssetUserData
Type | Name | Description | |
---|---|---|---|
void | AddAssetUserData
(
UAssetUserData* InUserData |
||
const TArray< UAssetUserData * > * | |||
UAssetUserData * | GetAssetUserDataOfClass
(
TSubclassOf< UAssetUserData > InUserDataClass |
||
void | RemoveUserDataOfClass
(
TSubclassOf< UAssetUserData > InUserDataClass |
Overridden from IInterface_AsyncCompilation
Type | Name | Description | |
---|---|---|---|
bool | IsCompiling () |
Returns whether or not the asset is currently being compiled |
Enums
Type | Name | Description | |
---|---|---|---|
ENotifyMaterialsEffectOnShaders |
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
Type | Name | Description | |
---|---|---|---|
uint32: 1 | bDitherMipMapAlpha_DEPRECATED | Removed. | |
TObjectPtr< class UTexture > | CompositeTexture | Use GetCompositeTexture() and SetCompositeTexture() instead. | |
TFieldPtrAccessor< FTextureResource > | Resource | Use GetResource() / SetResource() accessors instead. | |
FString | SourceFilePath_DEPRECATED |
Deprecated Functions
Type | Name | Description | |
---|---|---|---|
int64 | Use GetBuildRequiredMemoryEstimate instead | ||
PRAGMA_DISABLE_DEPRECATION_WARNINGSvoid | PreSave
(
const ITargetPlatform* TargetPlatform |
Use version that takes FObjectPreSaveContext instead. | |
void | UpdateCachedLODBias does nothing, remove call |