UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TextureImportSettings.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
10
11#include "TextureImportSettings.generated.h"
12
14
15/* What CompressionSettings runtime format should imported floating point textures use
16 */
17UENUM()
19{
20 /* Use "HDR" RGBA16F */
21 HDR_F16 = 0,
22 /* Use "HDRCompressed" , BC6H */
24 /* Use 32-bit float formats if the source is 32-bit, otherwise use 16-bit HDR */
26
27 PreviousDefault = HDR_F16 UMETA(Hidden) // legacy behavior
28};
29
30
31/* When should RGB colors be spread into neighboring fully transparent white pixels, replacing their RGB.
32 By default, this is done OnlyOnBinaryTransparency, not on PNG's with non-binary-transparency alpha channels.
33 The PNG format has two different ways of storing alpha, either as 1-bit binary transparency, or as full 8/16 bit alpha channels.
34
35 Used to be set from the TextureImporter/FillPNGZeroAlpha config value. Setting this option will supersede that.
36 */
37UENUM()
39{
40 /* Use the default behavior. For user settings, this means use project settings. For project settings, it's set from the TextureImporter/FillPNGZeroAlpha config value; default was OnlyOnBinaryTransparency. */
41 Default = 0,
42 /* Never infill RGB, import the PNG exactly as it is stored in the file. */
43 Never,
44 /* Only infill RGB on binary transparency; this is the default behavior. */
46 /* Always infill RGB to fully transparent white pixels, even for non-binary alpha channels. */
47 Always
48};
49
50UCLASS(config=Editor, defaultconfig, meta=(DisplayName="Texture Import"), MinimalAPI)
52{
54
55public:
56
57 UPROPERTY(config, EditAnywhere, Category=VirtualTextures, meta = (
58 DisplayName = "Auto Virtual Texturing Size",
59 ToolTip = "Automatically enable the 'Virtual Texture Streaming' texture setting for textures larger than or equal to this size. Zero to disable. This setting will not affect existing textures in the project."))
60 int32 AutoVTSize = 4096;
61
62 UPROPERTY(config, EditAnywhere, Category=VirtualTextures, meta = (
63 DisplayName = "Auto resize large textures",
64 ToolTip = "If not zero, textures over this size that are not VT will be resized to be equal to or less than this. Treated as pixel count limit for cubes and volumes. Must equal AutoVTSize if both are non-zero. This setting will not affect existing textures in the project."))
66
67 UPROPERTY(config, EditAnywhere, Category=ImportSettings, meta = (
68 DisplayName = "Turn on NormalizeNormals for normal maps",
69 ToolTip = "NormalizeNormals makes more correct normals in mip maps; it is recommended, but can be turned off to maintain legacy behavior. This setting is applied to newly imported textures, it does not affect existing textures in the project."))
71
72 UPROPERTY(config, EditAnywhere, Category=ImportSettings, meta = (
73 DisplayName = "Turn on fast mip generation filter",
74 ToolTip = "Use the fast mip filter on new textures; it is recommended, but can be turned off to maintain legacy behavior. This setting is applied to newly imported textures, it does not affect existing textures in the project."))
76
77 UPROPERTY(config, EditAnywhere, Category=ImportSettings, meta = (
78 DisplayName = "CompressionFormat to use for new float textures",
79 ToolTip = "Optionally use HDRCompressed (BC6H), or 32-bit adaptively, instead of HDR (RGBA16F) for floating point textures. This setting is applied to newly imported textures, it does not affect existing textures in the project."))
81
82 UPROPERTY(config, EditAnywhere, Category=ImportSettings, meta = (
83 DisplayName = "When to infill RGB in transparent white PNG",
86
87 UPROPERTY(config, EditAnywhere, Category=ImportSettings, meta = (
88 DisplayName = "Detect nonpow2 textures and set defaults",
89 ToolTip = "Sets them to NoMipMaps and uncompressed UI compression. If this is off, artists must imported UI textures up correctly by hand."))
91
92 //~ Begin UObject Interface
93
94 TEXTUREUTILITIESCOMMON_API virtual void PostInitProperties() override;
95
96 // Get the PNGInfill setting, with Default mapped to a concrete choice
97 TEXTUREUTILITIESCOMMON_API ETextureImportPNGInfill GetPNGInfillMapDefault() const;
98
99 // get AutoLimitDimension as a pixel count (squared), and with sanity checks applied
100 // zero means do not limit
101 TEXTUREUTILITIESCOMMON_API int64 GetAutoLimitPixelCount() const;
102
103 // IsImportAutoVTEnabled checks not just this config but also the project VT settings
104 TEXTUREUTILITIESCOMMON_API bool IsImportAutoVTEnabled() const;
105
106#if WITH_EDITOR
107 TEXTUREUTILITIESCOMMON_API virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
108#endif
109
110 //~ End UObject Interface
111};
112
113
114class UTexture;
115
117{
118#if WITH_EDITOR
119 /* Set default properties on Texture for newly imported textures, or reimports.
120 * Should be called after all texture properties are set, before PostEditChange()
121 */
123
124 /* Query if texture will be made VT automatically on import due to exceeding AutoVTSize
125 or other conditions which require it to be VT
126 only returns true if VT is enabled and auto-VT is enabled
127 */
129#endif
130
131 /* Get the default value for Texture->SRGB
132 * ImportImageSRGB is the SRGB setting of the imported image
133 */
135}
#define check(expr)
Definition AssertionMacros.h:314
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
int bit(int a, int b)
Definition DebugDraw.cpp:33
return true
Definition ExternalRpcRegistry.cpp:601
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UMETA(...)
Definition ObjectMacros.h:747
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
ETextureSourceFormat
Definition TextureDefines.h:351
TextureCompressionSettings
Definition TextureDefines.h:392
ETextureImportPNGInfill
Definition TextureImportSettings.h:39
ETextureImportFloatingPointFormat
Definition TextureImportSettings.h:19
if(Failed) console_printf("Failed.\n")
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition UnrealType.h:3087
Definition DeveloperSettings.h:24
Definition TextureImportSettings.h:52
UPROPERTY(config, EditAnywhere, Category=VirtualTextures, meta=(DisplayName="Auto Virtual Texturing Size", ToolTip="Automatically enable the 'Virtual Texture Streaming' texture setting for textures larger than or equal to this size. Zero to disable. This setting will not affect existing textures in the project.")) int32 AutoVTSize
Definition Texture.h:1219
Definition TextureImportSettings.cpp:115
TEXTUREUTILITIESCOMMON_API bool GetDefaultSRGB(TextureCompressionSettings TC, ETextureSourceFormat ImportImageFormat, bool ImportImageSRGB)
Definition TextureImportSettings.cpp:296
Definition ObjectMacros.h:924
Definition UnrealType.h:6865