Navigation
API > API/Developer > API/Developer/MaterialUtilities
Material utilities
| Name | FMaterialUtilities |
| Type | class |
| Header File | /Engine/Source/Developer/MaterialUtilities/Public/MaterialUtilities.h |
| Include Path | #include "MaterialUtilities.h" |
Syntax
class FMaterialUtilities : public IModuleInterface
Implements Interfaces
Classes
| Name | Remarks |
|---|---|
| FExportErrorManager | Contains errors generated when exporting material texcoord scales. |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| CurrentlyRendering | bool | Flag to indicate whether or not a texture is currently being rendered out | MaterialUtilities.h |
| RenderTargetPool | TArray< UTextureRenderTarget2D * > | Pool of available render targets, cached for re-using on consecutive property rendering | MaterialUtilities.h |
Functions
Public
Overridden from IModuleInterface
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void ShutdownModule() |
MaterialUtilities.h | ||
virtual void StartupModule() |
Begin IModuleInterface implementation | MaterialUtilities.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void AnalyzeMaterial
(
UMaterialInterface* InMaterial, |
Analyzes given material to determine how many texture coordinates and whether or not vertex colors are used within the material Graph | MaterialUtilities.h | |
static void AnalyzeMaterial
(
UMaterialInterface* InMaterial, |
MaterialUtilities.h | ||
static void ClearRenderTargetPool() |
Clears the pool with available render targets | MaterialUtilities.h | |
static float ComputeRequiredTexelDensityFromDrawDistance
(
const float InDrawDistance, |
Compute the required texel density needed to properly represent an object/objects covering the provided world space radius | MaterialUtilities.h | |
static float ComputeRequiredTexelDensityFromScreenSize
(
const float InScreenSize, |
Compute the required texel density needed to properly represent an object/objects covering the provided world space radius | MaterialUtilities.h | |
static UMaterialInstanceConstant * CreateFlattenMaterialInstance
(
UPackage* InOuter, |
Creates a flatten material instance and the required texture assets | MaterialUtilities.h | |
static FFlattenMaterial CreateFlattenMaterialWithSettings
(
const FMaterialProxySettings& InMaterialLODSettings |
Creates a FFlattenMaterial instance with the given MaterialProxySettings data | MaterialUtilities.h | |
static UMaterialInstanceConstant * CreateInstancedMaterial
(
UMaterialInterface* BaseMaterial, |
Creates an instanced material based of BaseMaterial | MaterialUtilities.h | |
static UMaterial * CreateMaterial
(
const FFlattenMaterial& InFlattenMaterial, |
Creates UMaterial object from a flatten material | MaterialUtilities.h | |
static UMaterialInterface * CreateProxyMaterialAndTextures
(
const FString& PackageName, |
Creates a proxy material and the required texture assets | MaterialUtilities.h | |
static UMaterialInterface * CreateProxyMaterialAndTextures
(
UPackage* OuterPackage, |
Creates a proxy material and the required texture assets | MaterialUtilities.h | |
static UTextureRenderTarget2D * CreateRenderTarget
(
bool bInForceLinearGamma, |
Creates and add or reuses a RenderTarget from the pool | MaterialUtilities.h | |
static UTexture2D * CreateTexture
(
UPackage* Outer, |
Generates a texture from an array of samples | MaterialUtilities.h | |
static UTexture2D * CreateTexture
(
UPackage* Outer, |
Generates a texture from an array of samples | MaterialUtilities.h | |
| Calculates an importance value for the given set of materials according to the texture sampler usage | MaterialUtilities.h | ||
| Creates bakes textures for a ULandscapeComponent | MaterialUtilities.h | ||
static bool ExportLandscapeMaterial
(
const ALandscapeProxy* InLandscape, |
Flattens specified landscape material | MaterialUtilities.h | |
static bool ExportLandscapeMaterial
(
const ALandscapeProxy* InLandscape, |
Flattens specified landscape material | MaterialUtilities.h | |
static bool ExportMaterialUVDensities
(
UMaterialInterface* InMaterial, |
MaterialUtilities.h | ||
static bool ExportMaterialUVDensities
(
UMaterialInterface* InMaterial, |
Get the material texcoord scales applied on each textures | MaterialUtilities.h | |
static FIntPoint FindMaxTextureSize
(
UMaterialInterface* InMaterialInterface, |
End IModuleInterface implementation Iterate through all textures used by the material and return the maximum texture resolution used | MaterialUtilities.h | |
| Generates a set of texture boxes according to the given weights and final atlas texture size | MaterialUtilities.h | ||
static FString GetFlattenMaterialTextureName
(
EFlattenMaterialProperties InProperty, |
Get the name of the Texture parameter associated with a given flatten material property | MaterialUtilities.h | |
static int32 GetTextureSizeFromTargetTexelDensity
(
const UE::Geometry::FDynamicMesh3& Mesh, |
Compute the required texture size to achieve a target texel density for the given mesh. | MaterialUtilities.h | |
static int32 GetTextureSizeFromTargetTexelDensity
(
double InMesh3DArea, |
Compute the required texture size to achieve a target texel density, given the world to UV space ratio. | MaterialUtilities.h | |
static int32 GetTextureSizeFromTargetTexelDensity
(
const FMeshDescription& InMesh, |
Compute the required texture size to achieve a target texel density for the given mesh. | MaterialUtilities.h | |
static bool IsValidFlattenMaterial
(
const UMaterialInterface* InBaseMaterial |
Validate that the provided material has all the required parameters needed to be considered a flattening material | MaterialUtilities.h | |
static void OptimizeFlattenMaterial
(
FFlattenMaterial& InFlattenMaterial |
Tries to optimize the flatten material's data by picking out constant values for the various properties | MaterialUtilities.h | |
| Tries to optimize the sample array (will set to const value if all samples are equal) | MaterialUtilities.h | ||
static void RemapUniqueMaterialIndices
(
const TArray< struct FSectionInfo >& InSections, |
Remaps material indices where possible to reduce the number of materials required for creating a proxy material | MaterialUtilities.h | |
static void ResizeFlattenMaterial
(
FFlattenMaterial& InFlattenMaterial, |
Resizes flatten material's data if applicable by comparing it with the original settings | MaterialUtilities.h | |
static bool SupportsExport
(
EBlendMode InBlendMode, |
Whether material utilities support exporting specified material blend mode and property | MaterialUtilities.h | |
static bool SupportsExport
(
bool bIsOpaque, |
MaterialUtilities.h |