materials-and-shaders

Author and drive Unreal Engine materials, instances, and runtime parameter changes in C++.

1|Updated Sep 6, 2026
One-click install
npx skills add https://github.com/ziyarduc/Baran-bk-game --skill materials-and-shaders-ziyarduc
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: materials-and-shaders
Source: https://github.com/ziyarduc/Baran-bk-game/tree/main/.agents/skills/materials-and-shaders
Command: npx skills add https://github.com/ziyarduc/Baran-bk-game --skill materials-and-shaders-ziyarduc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Unreal Engine material work involves a deep class hierarchy (UMaterial, MIC, MID), domain/blend/shading-model choices, and runtime parameter APIs where mistakes silently no-op or cause shader recompile hitches. This Skill provides grounded guidance on the material class hierarchy, parameter workflows, and the C++ API so you avoid common pitfalls like typos in parameter names, garbage-collected MIDs, and shader permutation explosions. ## Core Features & Use Cases - Master material and instance authoring: Build one parameterized base UMaterial, create UMaterialInstanceConstant variants in the editor, and spawn UMaterialInstanceDynamic copies at runtime via CreateDynamicMaterialInstance. - Runtime parameter control in C++: Set scalar, vector, and texture parameters with SetScalarParameterValue, SetVectorParameterValue, and SetTextureParameterValue, plus index-cache optimization for high-frequency updates. - Global parameters via collections: Drive world-state values like wetness or time-of-day through UMaterialParameterCollection and UKismetMaterialLibrary. - Performance and domain guidance: Choose material domain, blend mode, and shading model correctly, reduce shader permutations, and avoid translucency overdraw. - Use Case: A character takes damage in a Battle Royale game and you need a red damage tint to pulse on their mesh. Use this Skill to create a MID in BeginPlay, cache it in a UPROPERTY, and drive a DamageAmount scalar parameter from gameplay code. ## Quick Start Ask the assistant to create a dynamic material instance on a mesh component and change a scalar parameter at runtime in Unreal Engine C++.

Frequently Asked Questions about materials-and-shaders

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I change a material parameter at runtime in Unreal Engine C++?▼

Create a UMaterialInstanceDynamic by calling CreateDynamicMaterialInstance on the primitive component, then call SetScalarParameterValue, SetVectorParameterValue, or SetTextureParameterValue on it. Store the returned pointer in a UPROPERTY member so it is not garbage-collected.

What is the difference between UMaterialInstanceConstant and UMaterialInstanceDynamic?▼

A UMaterialInstanceConstant is an editor-authored asset for static art variants and cannot be modified at runtime. A UMaterialInstanceDynamic is created at runtime in C++ or Blueprint and supports live parameter changes while sharing the parent's compiled shader.

Why does SetScalarParameterValue silently do nothing in Unreal?▼

The parameter name must exactly match the parameter node name in the base material, using case-sensitive FName comparison. A typo causes a silent no-op, so verify the spelling against the material graph.

How do I set a global material parameter for all materials in Unreal?▼

Use a UMaterialParameterCollection asset and update it with UKismetMaterialLibrary::SetScalarParameterValue or SetVectorParameterValue. Every material referencing the collection sees the new value the same frame, but a material can reference at most two collections.

When should I use Masked instead of Translucent blend mode?▼

Prefer BLEND_Masked for foliage, fences, and cutout surfaces because it uses alpha testing with depth writes and no sorting cost. Reserve BLEND_Translucent for cases that physically require it, since large overlapping translucent surfaces cause expensive GPU overdraw.

Why does my mesh show the default material instead of my custom material?▼

The material is likely missing the required usage flag such as bUsedWithSkeletalMesh or bUsedWithInstancedStaticMeshes for the content type it is applied to. Enable the matching flag in the material and re-save it.