# FMaterialUtilities

Material utilities

## Navigation

Unreal Engine C++ API Reference > Developer > MaterialUtilities

## Inheritance Hierarchy

- IModuleInterface

## References

Module | MaterialUtilities
Header | /Engine/Source/Developer/MaterialUtilities/Public/MaterialUtilities.h
Include | #include "MaterialUtilities.h"

## Syntax

    class FMaterialUtilities : public [IModuleInterface](API\Runtime\Core\Modules\IModuleInterface)

## Remarks

Material utilities

## Functions

Type | Name | Description
--- | --- | ---
void | AnalyzeMaterial ( UMaterialInterface* InMaterial, const TArray< EMaterialProperty >&..., int32& OutNumTexCoords, bool& OutRequiresVertexData ) |
void | AnalyzeMaterial ( UMaterialInterface* InMaterial, const FMaterialProxySettings& InMa..., int32& OutNumTexCoords, bool& OutRequiresVertexData ) | Analyzes given material to determine how many texture coordinates and whether or not vertex colors are used within the material Graph
float | ComputeRequiredTexelDensityFromDrawDistance ( const float InDrawDistance, float InWorldSpaceRadius ) | Compute the required texel density needed to properly represent an object/objects covering the provided world space radius
float | ComputeRequiredTexelDensityFromScreenSize ( const float InScreenSize, float InWorldSpaceRadius ) | Compute the required texel density needed to properly represent an object/objects covering the provided world space radius
UMaterialIns... | CreateFlattenMaterialInstance ( UPackage* InOuter, const FMaterialProxySettings& InMa..., UMaterialInterface* InBaseMate..., const FFlattenMaterial& FlattenMat..., const FString& AssetBasePath, const FString& AssetBaseName, TArray< UObject* >& OutAssets..., FMaterialUpdateContext* Materi... ) | Creates a flatten material instance and the required texture assets
FFlattenMate... | CreateFlattenMaterialWithSettings ( const FMaterialProxySettings& InMa... ) | Creates a FFlattenMaterial instance with the given MaterialProxySettings data
UMaterialIns... | CreateInstancedMaterial ( UMaterialInterface* BaseMateri..., UPackage* InOuter, const FString& BaseName, EObjectFlags Flags ) | Creates an instanced material based of BaseMaterial
UMaterial &#... | CreateMaterial ( const FFlattenMaterial& InFlattenM..., UPackage* InOuter, const FString& BaseName, EObjectFlags Flags, const FMaterialProxySettings& Mate..., TArray< UObject* >& OutGenera..., const TextureGroup& InTextureGroup ) | Creates UMaterial object from a flatten material
UMaterialInt... | CreateProxyMaterialAndTextures ( const FString& PackageName, const FString& AssetName, const FBakeOutput& BakeOutput, const FMeshData& MeshData, const FMaterialData& MaterialData, UMaterialOptions* Options ) | Creates a proxy material and the required texture assets
UMaterialInt... | CreateProxyMaterialAndTextures ( UPackage* OuterPackage, const FString& AssetName, const FBakeOutput& BakeOutput, const FMeshData& MeshData, const FMaterialData& MaterialData, UMaterialOptions* Options ) | Creates a proxy material and the required texture assets
UTexture2D &... | CreateTexture ( UPackage* Outer, const FString& AssetLongName, FIntPoint Size, const TArray< FColor >& Samples, const FCreateTexture2DParameters& ..., EObjectFlags Flags ) | Generates a texture from an array of samples
UTexture2D &... | CreateTexture ( UPackage* Outer, const FString& AssetLongName, FIntPoint Size, const TArray< FColor >& Samples, TextureCompressionSettings Compress..., TextureGroup LODGroup, EObjectFlags Flags, bool bSRGB, const FGuid& SourceGuidHash ) | Generates a texture from an array of samples
void | DetermineMaterialImportance ( const TArray< UMaterialInterface&#..., TArray< float >& OutImportance ) | Calculates an importance value for the given set of materials according to the texture sampler usage
bool | ExportBaseColor ( ULandscapeComponent* Landscape..., int32 TextureSize, TArray< FColor >& OutSamples ) | Creates bakes textures for a ULandscapeComponent
bool | ExportLandscapeMaterial ( const ALandscapeProxy* InLands..., const TSet< FPrimitiveComponentId >..., FFlattenMaterial& OutFlattenMateri... ) | Flattens specified landscape material
bool | ExportLandscapeMaterial ( const ALandscapeProxy* InLands..., FFlattenMaterial& OutFlattenMateri... ) | Flattens specified landscape material
bool | ExportMaterialUVDensities ( UMaterialInterface* InMaterial, EMaterialQualityLevel::Type Quality..., ERHIFeatureLevel::Type FeatureLevel, FExportErrorManager& OutErrors ) | Get the material texcoord scales applied on each textures
FIntPoint | FindMaxTextureSize ( UMaterialInterface* InMaterial..., FIntPoint MinimumSize ) | End IModuleInterface implementation Iterate through all textures used by the material and return the maximum texture resolution used
void | GeneratedBinnedTextureSquares ( const FVector2D DestinationSize, TArray< float >& InTexureWeights, TArray< FBox2D >& OutGeneratedBoxe... ) | Generates a set of texture boxes according to the given weights and final atlas texture size
FString | GetFlattenMaterialTextureName ( EFlattenMaterialProperties InProper..., UMaterialInterface* InBaseMate... ) | Get the name of the Texture parameter associated with a given flatten material property
int32 | GetTextureSizeFromTargetTexelDensity ( const UE::Geometry::FDynamicMesh3&..., float TargetTexelDensity ) | Compute the required texture size to achieve a target texel density for the given mesh.
int32 | GetTextureSizeFromTargetTexelDensity ( const FMeshDescription& InMesh, float InTargetTexelDensity ) | Compute the required texture size to achieve a target texel density for the given mesh.
int32 | GetTextureSizeFromTargetTexelDensity ( double InMesh3DArea, double InMeshUVArea, double InTargetTexelDensity ) | Compute the required texture size to achieve a target texel density, given the world to UV space ratio.
bool | IsValidFlattenMaterial ( const UMaterialInterface* InBa... ) | Validate that the provided material has all the required parameters needed to be considered a flattening material
void | OptimizeFlattenMaterial ( FFlattenMaterial& InFlattenMateria... ) | Tries to optimize the flatten material's data by picking out constant values for the various properties
void | OptimizeSampleArray ( TArray< FColor >& InSamples, FIntPoint& InSampleSize ) | Tries to optimize the sample array (will set to const value if all samples are equal)
void | RemapUniqueMaterialIndices ( const TArray< struct FSectionInfo >..., const TArray< struct FRawMeshExt > ..., const TMap< FIntPoint, TArray< int3..., const FMaterialProxySettings& InMa..., const bool bBakeVertexData, const bool bMergeMaterials, TArray< bool >& OutMeshShouldBakeV..., TMap< FIntPoint, TArray< int32 > > ..., TArray< struct FSectionInfo >& Out... ) | Remaps material indices where possible to reduce the number of materials required for creating a proxy material
void | ResizeFlattenMaterial ( FFlattenMaterial& InFlattenMateria..., const FMeshProxySettings& InMeshPr... ) | Resizes flatten material's data if applicable by comparing it with the original settings

## Overridden from IModuleInterface

Type | Name | Description
--- | --- | ---
void | ShutdownModule () | Called before the module is unloaded, right before the module object is destroyed.
void | StartupModule () | Begin IModuleInterface implementation

## Classes

Type | Name | Description
--- | --- | ---
Public class | FExportErrorManager | Contains errors generated when exporting material texcoord scales.

## Constants

Name | Description
--- | ---
CurrentlyRendering | Flag to indicate whether or not a texture is currently being rendered out
RenderTargetPool | Pool of available render targets, cached for re-using on consecutive property rendering

## Deprecated Functions

Type | Name | Description
--- | --- | ---
bool | SupportsExport ( EBlendMode InBlendMode, EMaterialProperty InMaterialPropert... ) | Use SupportsExport(bool bIsOpaque, ...) function instead
bool | SupportsExport ( bool bIsOpaque, EMaterialProperty InMaterialPropert... ) | Use SupportsExport(bool bIsOpaque, ...) function instead

Ask questions and help your peers Developer Forums

Write your own tutorials or read those from others Learning Library

On this page

- Navigation
- Inheritance Hierarchy
- References
- Syntax
- Remarks
- Functions
- Overridden from IModuleInterface
- Classes
- Constants
- Deprecated Functions

## Privacy Preference Center

### Your Privacy

When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer. More information

- ### Strictly Necessary Cookies

  Always Active
  Strictly Necessary Cookies

  These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.

  Cookies Details‎

- ### Performance Cookies

  Performance Cookies

  These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.

  Cookies Details‎

- ### Functional Cookies

  Functional Cookies

  These cookies enable the website to provide enhanced functionality and personalization. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.

  Cookies Details‎

Consent Leg.Interest
Select All Vendors
Select All Vendors
Select All Hosts

Select All

- REPLACE-WITH-DYANMIC-HOST-ID

  ### 33Across

  View Third Party Cookies
  - Name
    cookie name

- REPLACE-WITH-DYANMIC-VENDOR-ID

  ### 33Across

  3 Purposes

  View Privacy Notice

  ### 33Across

  3 Purposes

  View Privacy Notice
  REPLACE-WITH-DYANMIC-VENDOR-ID

  Consent Purposes

  Location Based Ads

  Consent Allowed

  Legitimate Interest Purposes

  Personalize

  Require Opt-Out

  Special Purposes

  Location Based Ads

  Features

  Location Based Ads

  Special Features

  Location Based Ads

Clear Filters

Information storage and access

By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and personalize content.Privacy Policy