Navigation
API > API/Runtime > API/Runtime/Engine
Material Instances may be used to change the appearance of a material without incurring an expensive recompilation of the material. General modification of the material cannot be supported without recompilation, so the instances are limited to changing the values of predefined material parameters. The parameters are statically defined in the compiled material by a unique name, type and default value.
| Name | UMaterialInstanceConstant |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Public/Materials/MaterialInstanceConstant.h |
| Include Path | #include "Materials/MaterialInstanceConstant.h" |
Syntax
UCLASS (HideCategories=Object, CollapseCategories, BlueprintType, MinimalAPI)
class UMaterialInstanceConstant : public UMaterialInstance
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UMaterialInterface → UMaterialInstance → UMaterialInstanceConstant
Implements Interfaces
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UMaterialInstanceConstant
(
const FObjectInitializer& ObjectInitializer |
Materials/MaterialInstanceConstant.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ParameterStateId | FGuid | Unique ID for this material instance's parameter set Updated on changes in the editor to allow those changes to be detected | Materials/MaterialInstanceConstant.h | |
| PhysMaterialMask | TObjectPtr< class UPhysicalMaterialMask > | Physical material mask to use for this graphics material. Used for sounds, effects etc. | Materials/MaterialInstanceConstant.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ClearParameterValuesEditorOnly () |
Clear all parameter overrides on this material instance. | Materials/MaterialInstanceConstant.h | |
void CopyMaterialUniformParametersEditorOnly
(
UMaterialInterface* Source, |
Copies the uniform parameters (scalar, vector and texture) from a material or instance hierarchy. | Materials/MaterialInstanceConstant.h | |
float K2_GetScalarParameterValue
(
FName ParameterName |
Get the scalar (float) parameter value from an MIC | Materials/MaterialInstanceConstant.h |
|
UTextureCollection * K2_GetTextureCollectionParameterValue
(
FName ParameterName |
Get the MIC texture collection parameter value | Materials/MaterialInstanceConstant.h |
|
| Get the MIC texture parameter value | Materials/MaterialInstanceConstant.h |
|
|
FLinearColor K2_GetVectorParameterValue
(
FName ParameterName |
Get the MIC vector parameter value | Materials/MaterialInstanceConstant.h |
|
void SetFontParameterValueEditorOnly
(
const FMaterialParameterInfo& ParameterInfo, |
Materials/MaterialInstanceConstant.h | ||
void SetNaniteOverrideMaterial
(
bool bInEnableOverride, |
Set an override material which will be used when rendering with nanite. | Materials/MaterialInstanceConstant.h |
|
void SetParentEditorOnly
(
UMaterialInterface* NewParent, |
Set the parent of this material instance. | Materials/MaterialInstanceConstant.h | |
void SetRuntimeVirtualTextureParameterValueEditorOnly
(
const FMaterialParameterInfo& ParameterInfo, |
Materials/MaterialInstanceConstant.h | ||
void SetScalarParameterAtlasEditorOnly
(
const FMaterialParameterInfo& ParameterInfo, |
Materials/MaterialInstanceConstant.h | ||
void SetScalarParameterValueEditorOnly
(
const FMaterialParameterInfo& ParameterInfo, |
Materials/MaterialInstanceConstant.h | ||
void SetSparseVolumeTextureParameterValueEditorOnly
(
const FMaterialParameterInfo& ParameterInfo, |
Materials/MaterialInstanceConstant.h | ||
void SetTextureCollectionParameterValueEditorOnly
(
const FMaterialParameterInfo& ParameterInfo, |
Materials/MaterialInstanceConstant.h | ||
void SetTextureParameterValueEditorOnly
(
const FMaterialParameterInfo& ParameterInfo, |
Materials/MaterialInstanceConstant.h | ||
void SetVectorParameterValueEditorOnly
(
const FMaterialParameterInfo& ParameterInfo, |
Set the value parameters. | Materials/MaterialInstanceConstant.h |
Overridden from UMaterialInstance
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void UpdateCachedData() |
Materials/MaterialInstanceConstant.h |
Overridden from UMaterialInterface
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual uint32 ComputeAllStateCRC() |
Materials/MaterialInstanceConstant.h | ||
virtual UPhysicalMaterialMask * GetPhysicalMaterialMask() |
Return a pointer to the physical material mask used by this material instance. | Materials/MaterialInstanceConstant.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void FinishDestroy() |
Materials/MaterialInstanceConstant.h | ||
virtual void GetAssetRegistryTags
(
FAssetRegistryTagsContext Context |
Materials/MaterialInstanceConstant.h | ||
virtual void PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Materials/MaterialInstanceConstant.h | ||
virtual void PostLoad() |
Materials/MaterialInstanceConstant.h |