FMaterialFunction
A material function: a .mmatfunc asset holding a sub-graph whose typed pins are its FunctionInput / FunctionOutput nodes. It is never compiled on its own — MaterialGraph::Resolve inlines it into every caller at compile time, so the caller's emitted source (and therefore its hash, its cooked blob names and its sidecar) tracks the function's body: editing a function re-identifies every material that calls it, which is exactly what makes "callers recompile through the asset-reload path" true.
- Module
- AssetSystem
- Header
#include "AssetSystem/Assets/MaterialFunction.h"- Namespace
Mowo
Schema (MDF, schema_version stamped): MaterialFunction "Fresnel" { schema_version: 1 description: "..." category: "Utility" Graph { ...MaterialGraph::Serialize... }
Properties
| Type | Name | Description |
|---|---|---|
static constexpr uint32_t | kSchemaVersion | Default 1. |
static const char* const | kExtension | The canonical extension (EFileType::MaterialFunction); a reader also takes the legacy spelling, FFileTypes::ReadableExtensions. |
std::string | name | |
std::string | description | |
std::string | category | |
MaterialGraph | graph |
Public functions
| Returns | Name | Description |
|---|---|---|
std::vector<MaterialGraph::FFunctionInputDecl> | Inputs | |
uint64_t | OutputNodeId | |
void | Serialize | |
bool | Deserialize | |
std::string | ToString | |
bool | FromString | |
bool | LoadFromFile | |
bool | SaveToFile | |
FMaterialFunction | MakeDefault | A starter body: one float4 input wired straight to the output, so a freshly minted function already compiles when a caller drops it in. |
bool | Equals |
Function details
Inputs
std::vector<MaterialGraph::FFunctionInputDecl> Inputs() constOutputNodeId
uint64_t OutputNodeId() constSerialize
void Serialize(MdfDocument& doc) constDeserialize
bool Deserialize(const MdfDocument& doc, const std::string& label)ToString
std::string ToString() constFromString
bool FromString(const std::string& text, const std::string& label)LoadFromFile
bool LoadFromFile(const std::string& path)SaveToFile
bool SaveToFile(const std::string& path) constMakeDefault
static FMaterialFunction MakeDefault(const std::string& functionName)A starter body: one float4 input wired straight to the output, so a freshly minted function already compiles when a caller drops it in.
Equals
bool Equals(const FMaterialFunction& other) const