Logo: Ue Materials And Shaders

Ue Materials And Shaders

Communautéit
kevinpbuckley
ue-materials-and-shaders

Author and drive Unreal materials — UMaterial (the node graph asset), material instances (UMaterialInstanceConstant for editor-authored variants, UMaterialInstanceDynamic for runtime parameter changes), material domain (Surface/Deferred Decal/Light Function/Post Process/UI/Volume), shading models (Default Lit/Unlit/Subsurface/Clear Coat/Hair/Cloth/Eye), blend modes (Opaque/Masked/Translucent/Additive), scalar/vector/texture parameters, material functions, material parameter collections (global scene-wide values), and the material C++ API (CreateDynamicMaterialInstance, SetScalarParameterValue, SetVectorParameterValue, SetTextureParameterValue, UKismetMaterialLibrary). Use when creating materials, making parameterized variants, changing material parameters at runtime, setting global weather or world-state parameters, fixing material shader permutation count or translucency overdraw, or cross-referencing the material class hierarchy.

Iwwersiicht

Editeurkevinpbuckley
Repositoryunreal-engine-skills
Skill-Nummue-materials-and-shaders
Stären
89
Forks
9
Matgeliwwert Dateien
3
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 3 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    kevinpbuckley huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Ue Materials And Shaders an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/kevinpbuckley/unreal-engine-skills/tree/master/skills/core/ue-materials-and-shaders
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/kevinpbuckley/unreal-engine-skills.git /tmp/unreal-engine-skills
mkdir -p .claude/skills
cp -r /tmp/unreal-engine-skills/skills/core/ue-materials-and-shaders .claude/skills/ue-materials-and-shaders
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Ue Materials And Shaders an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Ue Materials And Shaders automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Ue Materials And Shaders net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Materials & shaders

For graph-specific effects, use ue-material-graph-effects. For reusable PBR graph structure and texture contracts, use ue-master-material-authoring. For terrain shading, use ue-auto-landscape-materials or ue-landscape-rvt-and-grass as appropriate.

For generated tissue or other large organic surfaces, see organic surface projection and seam diagnosis. Distinguish UV seams, image-border wrapping and split mesh normals before changing the shader; retain approved lighting and material appearance on unaffected assets.

UE materials are node graphs that compile to HLSL shaders. The central workflow idea is parameters + instances: one parameterized base material, cheap asset variants (constant instances), and runtime-tweakable copies (dynamic instances). Understanding where to put logic — parameter vs. static switch vs. separate material — determines both quality and compile cost.

When to use this skill

  • Creating a material or family of material variants from a shared base.
  • Changing material parameters at runtime (damage tint, team color, wetness, dissolve amount).
  • Choosing domain, shading model, or blend mode for a material.
  • Fixing shader permutation counts or translucency overdraw performance issues.
  • Setting world-wide values through a material parameter collection.
  • Cross-referencing UMaterial, UMaterialInstance, UMaterialInstanceDynamic, or UMaterialParameterCollection in C++.

The material class hierarchy

UObject
└── UMaterialInterface          (abstract base; common API for all material types)
    ├── UMaterial               (the base node-graph asset — "the shader")
    └── UMaterialInstance       (abstract; instance overriding a parent)
        ├── UMaterialInstanceConstant  (MIC — editor-authored static variants)
        └── UMaterialInstanceDynamic   (MID — runtime-writable copy)

Store and pass materials as UMaterialInterface* so any concrete type fits.

Source locations (UE 5.8 Engine/Source/Runtime/Engine/Public/Materials/):

  • MaterialInterface.h — UMaterialInterface:351 (common interface, GetMaterial, GetRenderProxy, property getters).
  • Material.h — UMaterial:448 (MaterialDomain:482, BlendMode:486, ShadingModel:511, bUsedWithSkeletalMesh:703, GetDefaultMaterial:1455).
  • MaterialInstance.h — UMaterialInstance:626 (shared parameter storage and hierarchy traversal).
  • MaterialInstanceConstant.h — UMaterialInstanceConstant:20 (editor-only setters; read-only at runtime).
  • MaterialInstanceDynamic.h — UMaterialInstanceDynamic:14, Create:176, SetScalarParameterValue:24, SetVectorParameterValue:109, SetTextureParameterValue:65.
  • MaterialParameterCollection.h — UMaterialParameterCollection:78.

See references/material-instances-and-parameters.md for a full parameter-type breakdown and a worked C++ example.

Key material settings (UMaterial properties)

Material domain (EMaterialDomain, MaterialDomain.h:12)

Enum valueUse
MD_Surfacegeometry surfaces — the default for meshes
MD_DeferredDecaldecal projectors on surfaces
MD_LightFunctionmodifies a light's intensity/color pattern
MD_PostProcesscustom post-process pass
MD_UIUMG/Slate widgets
MD_Volumevolumetric materials (Heterogeneous Volumes)

Blend mode (EBlendMode, Engine/Classes/Engine/EngineTypes.h:245)

Enum valueCostNotes
BLEND_Opaquecheapestdepth-writes; no sorting needed
BLEND_Maskedlowalpha-test cutout; no overdraw; uses clip instruction
BLEND_Translucentexpensiveno depth-write by default; sorting required
BLEND_Additivemoderateadds to scene; good for glow/sparks
BLEND_Modulateraremultiplies into scene

Prefer BLEND_Masked over BLEND_Translucent for foliage and fences. Use translucency only where physically required.

Shading model (EMaterialShadingModel, EngineTypes.h:707)

MSM_DefaultLit, MSM_Unlit, MSM_Subsurface, MSM_SubsurfaceProfile, MSM_ClearCoat, MSM_TwoSidedFoliage, MSM_Hair, MSM_Cloth, MSM_Eye, MSM_SingleLayerWater, MSM_ThinTranslucent.

Each shading model enables different material inputs; not all inputs are meaningful for every model.

Master material → instances — the authoring pattern

  1. Author one UMaterial with parameter nodes (Scalar Parameter, Vector Parameter, Texture Parameter) for everything that varies across surfaces.
  2. Create UMaterialInstanceConstant assets (child instances) in the Content Browser for static art variants — they share the compiled shader, adding no recompile cost and almost no memory overhead.
  3. At runtime, call CreateDynamicMaterialInstance on a component to get a UMaterialInstanceDynamic when a value must change during play.

This limits shader permutations versus authoring many separate materials.

See references/material-graph-and-domains.md for material graph authoring concepts: PBR inputs, material functions, material attributes, static switches, and custom HLSL nodes.

Runtime parameters (MID) in C++

cpp
// PrimitiveComponent.h:1629 — creates a MID from SourceMaterial and assigns it
// to slot ElementIndex; returns the new MID.
UMaterialInstanceDynamic* MID =
    MeshComp->CreateDynamicMaterialInstance(0, BaseMaterial);

// MaterialInstanceDynamic.h — three core setters (thread-safe game-thread calls)
MID->SetScalarParameterValue(TEXT("DamageAmount"), 0.75f);
MID->SetVectorParameterValue(TEXT("TeamColor"), FLinearColor(0.f, 0.f, 1.f, 1.f));
MID->SetTextureParameterValue(TEXT("DetailTex"), MyTexture);

CreateDynamicMaterialInstance creates the MID and assigns it to the slot in one call. Parameter names must match the Parameter nodes in the base material exactly (case-sensitive FName comparison). Typos silently no-op.

To create a standalone MID without assigning it to a slot:

cpp
UMaterialInstanceDynamic* MID =
    UMaterialInstanceDynamic::Create(BaseMaterial, this);
// Assign later with SetMaterial / CreateDynamicMaterialInstance
MeshComp->SetMaterial(0, MID);

High-frequency calls on the same MID can use the index-cache API (InitializeScalarParameterAndGetIndex + SetScalarParameterByIndex) to avoid repeated name lookups.

Material parameter collections (global parameters)

UMaterialParameterCollection is a data asset holding up to 1024 scalar and 1024 vector parameters readable by any material in the project. One write propagates to every referencing material in the same frame — useful for world-state values (wetness, time-of-day tint, wind strength).

cpp
// Kismet/KismetMaterialLibrary.h:30
// Set a scalar parameter on a collection from C++ game-thread code:
UKismetMaterialLibrary::SetScalarParameterValue(
    this, WetnessCollection, TEXT("GlobalWetness"), 0.8f);

UKismetMaterialLibrary::SetVectorParameterValue(
    this, TODCollection, TEXT("SunColor"),
    FLinearColor(1.f, 0.85f, 0.6f, 1.f));

A material can reference at most two collections. Adding parameters to a collection re-triggers a recompile of all referencing materials; add parameters in bulk in an empty map to avoid repeated hitching.

See references/material-cpp-and-collections.md for the UKismetMaterialLibrary API, CopyScalarAndVectorParameters, and index-cache optimization.

Usage flags

Each unique UMaterial must have its "Used with ..." flags enabled for every content type it will be applied to (bUsedWithSkeletalMesh, bUsedWithNiagaraSprites, bUsedWithInstancedStaticMeshes, etc.). Missing flags cause the engine to use a default material instead. Each enabled flag adds one or more shader permutations.

Enable only what the content actually uses; extra usages silently grow compile time.

Performance guidance

  • Prefer instances: fewer base materials = fewer shader permutations = less compile time and PSO count.
  • Static Switch parameters: feature toggles compiled per MIC — zero runtime branch cost. Minimize the total number of static switch combinations in use.
  • Instruction count: visible in the material stats panel; keep pixel shaders well under a few hundred instructions for mobile.
  • Texture samplers: each material stage has a hard platform limit (typically 16 per shader stage). Shared sampler nodes help.
  • Translucent overdraw: large overlapping translucent surfaces stall the GPU. Consider BLEND_Masked for cutouts and dithered LOD transitions.
  • Use the Material Analyzer (Windows → Material Analyzer) to find redundant materials and duplicate parameter overrides.

Gotchas

  • Parameter name typos in Set*ParameterValue silently no-op — verify names match the parameter nodes exactly.
  • Changing a UMaterial directly at runtime (e.g. swapping its texture references) triggers a recompile and hitches. Create a MID instead.
  • Editing a UMaterialInstanceConstant at runtime — MICs are editor assets; only Set*EditorOnly functions exist. Use MID for any runtime mutation.
  • Missing usage flag — the mesh shows the default material with no error in the log by default. Enable the flag and re-save the material.
  • Two-collection limit: a single material graph can reference at most two UMaterialParameterCollection assets.
  • Static switch combinations: each unique combination is a separate compiled shader. With N static switches you can have 2^N permutations.
  • MID lifetime: hold the returned UMaterialInstanceDynamic* in a UPROPERTY() member or it will be garbage-collected.

Version notes — Substrate materials

UE 5.8 ships with the Substrate material framework (opt-in project setting). Substrate replaces the single shading model and blend mode selectors with a layered slab-based authoring model. The C++ instance API (UMaterialInstanceDynamic, Set*ParameterValue) is unchanged. Some EMaterialShadingModel enum values are Substrate-only (MSM_Strata, hidden from the non-Substrate editor). The BLEND_TranslucentColoredTransmittance and BLEND_ColoredTransmittanceOnly blend modes are also Substrate-only. Non-Substrate projects should ignore these.

See references/material-graph-and-domains.md for a Substrate overview.

Cross-references

  • ue-meshes-static-and-skeletal — assigning materials to mesh components and slots; UStaticMeshComponent::SetMaterial, skeletal mesh material slots.
  • ue-actors-and-components — component lifecycle; when to call CreateDynamicMaterialInstance (after component is registered / in BeginPlay).

References & source material

Engine source (UE 5.8, Engine/Source/Runtime/Engine/):

  • Public/Materials/MaterialInterface.h — UMaterialInterface:351.
  • Public/Materials/Material.h — UMaterial:448; MaterialDomain:482; BlendMode:486; ShadingModel:511; usage flags from :703.
  • Public/Materials/MaterialInstance.h — UMaterialInstance:626.
  • Public/Materials/MaterialInstanceConstant.h — UMaterialInstanceConstant:20.
  • Public/Materials/MaterialInstanceDynamic.h — UMaterialInstanceDynamic:14; Create:176; SetScalarParameterValue:24; SetVectorParameterValue:109; SetTextureParameterValue:65.
  • Public/Materials/MaterialParameterCollection.h — UMaterialParameterCollection:78.
  • Public/MaterialDomain.h — EMaterialDomain:12 (all domain enum values).
  • Classes/Engine/EngineTypes.h — EBlendMode:245; EMaterialShadingModel:707.
  • Classes/Kismet/KismetMaterialLibrary.h — UKismetMaterialLibrary:22; SetScalarParameterValue:30; SetVectorParameterValue:34.
  • Classes/Components/PrimitiveComponent.h — SetMaterial:1600; CreateDynamicMaterialInstance:1629.

Official docs (UE 5.8):

Deep-dive references in this skill:

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Ue Materials And Shaders?

Author and drive Unreal materials — UMaterial (the node graph asset), material instances (UMaterialInstanceConstant for editor-authored variants, UMaterialInstanceDynamic for runtime parameter changes), material domain (Surface/Deferred Decal/Light Function/Post Process/UI/Volume), shading models (Default Lit/Unlit/Subsurface/Clear Coat/Hair/Cloth/Eye), blend modes (Opaque/Masked/Translucent/Additive), scalar/vector/texture parameters, material functions, material parameter collections (global scene-wide values), and the material C++ API (CreateDynamicMaterialInstance, SetScalarParameterVal...

Firwat Ue Materials And Shaders op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Ue Materials And Shaders besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Ue Materials And Shaders an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/kevinpbuckley/unreal-engine-skills/tree/master/skills/core/ue-materials-and-shaders an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Ue Materials And Shaders benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Ue Materials And Shaders benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Ue Materials And Shaders domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Ue Materials And Shaders gratis?

kevinpbuckley huet de Skill op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇