Navigation
API > API/Runtime > API/Runtime/Engine
| Name | UTexture2D |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/Engine/Texture2D.h |
| Include Path | #include "Engine/Texture2D.h" |
Syntax
UCLASS (HideCategories=Object, MinimalAPI, BlueprintType)
class UTexture2D : public UTexture
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UStreamableRenderAsset → UTexture → UTexture2D
Implements Interfaces
Derived Classes
UTexture2D derived class hierarchy
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UTexture2D
(
const FObjectInitializer& ObjectInitializer |
Engine/Texture2D.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AddressX | TEnumAsByte< enum TextureAddress > | The addressing mode to use for the X axis. | Engine/Texture2D.h |
|
| AddressY | TEnumAsByte< enum TextureAddress > | The addressing mode to use for the Y axis. | Engine/Texture2D.h |
|
| bHasBeenPaintedInEditor | uint8 | Whether the texture has been painted in the editor. | Engine/Texture2D.h | |
| CookedPlatformData | TMap< FString, FTexturePlatformData * > | Cooked platform data for this texture | Engine/Texture2D.h | |
| CPUCopyTexture | TObjectPtr< UTexture2D > | If we ever show the CPU accessible image in the editor we'll need a transient texture with those bits in it. | Engine/Texture2D.h | |
| FirstResourceMemMip | int32 | Keep track of first mip level used for ResourceMem creation | Engine/Texture2D.h | |
| ResourceMem | FTexture2DResourceMem * | Memory used for directly loading bulk mip data | Engine/Texture2D.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bTemporarilyDisableStreaming | uint8 | True if streaming is temporarily disabled so we can update subregions of this texture's resource without streaming clobbering it. | Engine/Texture2D.h |
|
| ImportedSize | FIntPoint | The imported size of the texture. | Engine/Texture2D.h | |
| PrivatePlatformData | FTexturePlatformData * | The derived data for this texture on this platform. | Engine/Texture2D.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FSharedImageConstRefBlueprint Blueprint_GetCPUCopy() |
Engine/Texture2D.h |
|
|
int32 Blueprint_GetSizeX() |
Gets the X size of the texture, in pixels | Engine/Texture2D.h |
|
int32 Blueprint_GetSizeY() |
Gets the Y size of the texture, in pixels | Engine/Texture2D.h |
|
int32 CalcTextureMemorySize
(
int32 MipCount |
Calculates the size of this texture in bytes if it had MipCount miplevels streamed in. | Engine/Texture2D.h | |
UTextureAllMipDataProviderFactory * GetAllMipProvider() |
Engine/Texture2D.h | ||
FSharedImageConstRef GetCPUCopy () |
If the texture has a cpu accessible copy, this returns that copy. | Engine/Texture2D.h | |
| Creates and returns a 2d texture that holds the CPU copy. | Engine/Texture2D.h | ||
int32 GetExtData() |
Engine/Texture2D.h | ||
FIntPoint GetImportedSize() |
Retrieves the size of the source image from which the texture was created. | Engine/Texture2D.h | |
virtual bool GetInitialMipData
(
int32 InFirstMipToLoad, |
Retrieve initial texel data for mips, starting from FirstMipToLoad, up to the last mip in the texture. | Engine/Texture2D.h | |
int32 GetMinTextureResidentMipCount () |
Returns the minimum number of mips that must be resident in memory (cannot be streamed). | Engine/Texture2D.h | |
void GetMipData
(
int32 FirstMipToLoad, |
Get the PlatformData mip data starting with the specified mip index. | Engine/Texture2D.h | |
int32 GetMipTailBaseIndex() |
Engine/Texture2D.h | ||
int32 GetNumMips() |
Engine/Texture2D.h | ||
int32 GetNumMipsAllowed
(
bool bIgnoreMinResidency |
Calculates the maximum number of mips that will be in this texture after cooking (eg. after the "drop mip" lod bias is applied). | Engine/Texture2D.h | |
int32 GetNumResidentMips() |
Engine/Texture2D.h | ||
EPixelFormat GetPixelFormat
(
uint32 LayerIndex |
Engine/Texture2D.h | ||
| Get the derived data for this texture on this platform. | Engine/Texture2D.h | ||
const FTexturePlatformData * GetPlatformData () |
Get the const derived data for this texture on this platform. | Engine/Texture2D.h | |
const TIndirectArray< FTexture2DMipMap > & GetPlatformMips() |
Engine/Texture2D.h | ||
bool GetResourceMemSettings
(
int32 FirstMipIdx, |
Calculates and returns the corresponding ResourceMem parameters for this texture. | Engine/Texture2D.h | |
int32 GetSizeX() |
Trivial accessors. | Engine/Texture2D.h | |
int32 GetSizeY() |
Engine/Texture2D.h | ||
bool GetSourceArtCRC
(
uint32& OutSourceCRC |
Get the CRC of the source art pixels. | Engine/Texture2D.h | |
bool HasAlphaChannel() |
Returns true if the runtime texture has an alpha channel that is not completely white. | Engine/Texture2D.h | |
bool HasSameSourceArt
(
UTexture2D* InTexture |
See if the source art of the two textures matches... | Engine/Texture2D.h | |
virtual bool IsVirtualTexturedWithContinuousUpdate() |
Returns true if this virtual texture requests round-robin updates of the virtual texture pages. | Engine/Texture2D.h | |
virtual bool IsVirtualTexturedWithSinglePhysicalPool () |
Returns true if this virtual texture requires that it's physical pool is never split by the r.VT.PageTableSupportType=2 setting. | Engine/Texture2D.h | |
virtual bool IsVirtualTexturedWithSinglePhysicalSpace () |
Returns true if this virtual texture uses a single physical space all of its texture layers. | Engine/Texture2D.h | |
virtual void RefreshSamplerStates() |
Update the offset for mip map lod bias. This is added to any existing mip bias values. | Engine/Texture2D.h | |
void SetPlatformData
(
FTexturePlatformData* PlatformData |
Set the derived data for this texture on this platform. | Engine/Texture2D.h | |
void TemporarilyDisableStreaming() |
Temporarily disable streaming so we update subregions of this texture without streaming clobbering it. | Engine/Texture2D.h | |
void UpdateTextureRegions
(
int32 MipIndex, |
Asynchronously update a set of regions of a texture with new data. | Engine/Texture2D.h |
Overridden from UTexture
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool AreDownscalePropertiesEditable () |
Returns true if the Downscale and DownscaleOptions properties should be editable in the UI. | Engine/Texture2D.h | |
virtual uint32 CalcTextureMemorySizeEnum
(
ETextureMipCount Enum |
Calculates the size of this texture if it had MipCount miplevels streamed in. | Engine/Texture2D.h | |
virtual FTextureResource * CreateResource() |
Implemented by subclasses to create a new resource for the texture. | Engine/Texture2D.h | |
virtual float GetAverageBrightness
(
bool bIgnoreTrueBlack, |
Gets the average brightness of the texture (in linear space) | Engine/Texture2D.h | |
virtual TMap< FString, FTexturePlatformData * > * GetCookedPlatformData() |
Engine/Texture2D.h | ||
virtual EMaterialValueType GetMaterialType() |
Engine/Texture2D.h | ||
virtual FTexturePlatformData ** GetRunningPlatformData() |
Textures that use the derived data cache must override this function and provide a pointer to the linked list of platform data. | Engine/Texture2D.h | |
virtual uint32 GetSurfaceArraySize() |
Engine/Texture2D.h | ||
virtual float GetSurfaceDepth() |
Engine/Texture2D.h | ||
virtual float GetSurfaceHeight() |
Engine/Texture2D.h | ||
virtual float GetSurfaceWidth() |
Engine/Texture2D.h | ||
virtual TextureAddress GetTextureAddressX() |
Engine/Texture2D.h | ||
virtual TextureAddress GetTextureAddressY() |
Engine/Texture2D.h | ||
virtual ETextureClass GetTextureClass() |
Get Texture Class | Engine/Texture2D.h | |
virtual bool IsCurrentlyVirtualTextured () |
Returns if the texture is actually being rendered using virtual texturing right now. | Engine/Texture2D.h | |
virtual bool IsDefaultTexture() |
Returns true if the current texture is a default placeholder because compilation is still ongoing. | Engine/Texture2D.h | |
virtual void UpdateResourceWithParams
(
EUpdateResourceFlags InFlags |
Creates a new resource for the texture, and updates any cached references to the resource. | Engine/Texture2D.h |
Overridden from UStreamableRenderAsset
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual int32 CalcCumulativeLODSize
(
int32 NumLODs |
Engine/Texture2D.h | ||
virtual bool StreamIn
(
int32 NewMipCount, |
Loads mips from disk to memory. Only usable if the asset is streamable. | Engine/Texture2D.h | |
virtual bool StreamOut
(
int32 NewMipCount |
Unload some mips from memory. Only usable if the asset is streamable. | Engine/Texture2D.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BeginDestroy() |
Engine/Texture2D.h | ||
virtual void GetAssetRegistryTags
(
FAssetRegistryTagsContext Context |
Engine/Texture2D.h | ||
virtual void GetAssetRegistryTags
(
TArray< FAssetRegistryTag >& OutTags |
Engine/Texture2D.h | ||
virtual FString GetDesc() |
Engine/Texture2D.h | ||
virtual void GetResourceSizeEx
(
FResourceSizeEx& CumulativeResourceSize |
Returns the size of the object/ resource for display to artists/ LDs in the Editor. | Engine/Texture2D.h | |
virtual bool IsReadyForAsyncPostLoad() |
Engine/Texture2D.h | ||
virtual void OnCookEvent
(
UE::Cook::ECookEvent CookEvent, |
Engine/Texture2D.h | ||
virtual void PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Engine/Texture2D.h | ||
virtual void PostEditUndo() |
Called after an editor or undo operation is formed on texture | Engine/Texture2D.h | |
virtual void PostLinkerChange() |
Engine/Texture2D.h | ||
virtual void PostLoad() |
Engine/Texture2D.h | ||
virtual void PreSave
(
FObjectPreSaveContext ObjectSaveContext |
Engine/Texture2D.h | ||
virtual void Serialize
(
FArchive& Ar |
Engine/Texture2D.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static UTexture2D * CreateTransient
(
int32 InSizeX, |
Creates and initializes a new Texture2D with the requested settings. | Engine/Texture2D.h | |
static UTexture2D * CreateTransientFromImage
(
const FImage* InImage, |
Creates a new texture2d from the first slice of the given image. | Engine/Texture2D.h | |
static float GetGlobalMipMapLODBias() |
Returns the global mip map bias applied as an offset for 2d textures. | Engine/Texture2D.h |