ue-materials-and-shaders

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

55|5|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/kevinpbuckley/unreal-engine-skills --skill ue-materials-and-shaders-kevinpbuckley
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ue-materials-and-shaders
Source: https://github.com/kevinpbuckley/unreal-engine-skills/tree/main/skills/core/ue-materials-and-shaders
Command: npx skills add https://github.com/kevinpbuckley/unreal-engine-skills --skill ue-materials-and-shaders-kevinpbuckley

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Working with Unreal Engine materials requires knowing the correct class hierarchy (UMaterial, UMaterialInstanceConstant, UMaterialInstanceDynamic), the right domain/blend/shading model settings, and the exact C++ API for runtime parameter changes — mistakes like editing a MIC at runtime or mistyping a parameter name silently fail or cause recompile hitches. ## Core Features & Use Cases - Material class hierarchy and settings: Maps UMaterialInterface, UMaterial, MIC, and MID with exact UE 5.8 engine source locations, plus tables for material domain, blend mode, and shading model enums. - Runtime parameter control in C++: Provides working code for CreateDynamicMaterialInstance, SetScalarParameterValue, SetVectorParameterValue, SetTextureParameterValue, and the index-cache optimization for high-frequency updates. - Material parameter collections: Explains global scene-wide parameters via UKismetMaterialLibrary, including the two-collection limit and 1024-parameter ceiling. - Use Case: A character takes damage and needs a red tint flash — use this Skill to create a MID in BeginPlay, hold it in a UPROPERTY, and call SetScalarParameterValue with the correct parameter name. ## Quick Start Use the ue-materials-and-shaders skill to create a dynamic material instance on my mesh component and change its DamageAmount scalar parameter at runtime.

Frequently Asked Questions about ue-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 C++?

Call CreateDynamicMaterialInstance on the primitive component to get a UMaterialInstanceDynamic, then use SetScalarParameterValue, SetVectorParameterValue, or SetTextureParameterValue. Parameter names must exactly match the parameter nodes in the base material or the call silently no-ops.

What is the difference between MIC and MID in Unreal Engine?

A UMaterialInstanceConstant is an editor-authored asset for static art variants and cannot be changed at runtime. A UMaterialInstanceDynamic is created at runtime in C++ or Blueprint and supports parameter changes, sharing the parent's compiled shader with no recompile cost.

Why does SetScalarParameterValue do nothing in Unreal?

The most common cause is a parameter name typo, since FName comparison is case-sensitive and mismatches silently no-op. Also verify you are setting on a MID, not a MIC, and that the MID is held in a UPROPERTY so it is not garbage-collected.

How many material parameter collections can one material use?

A single UMaterial graph can reference at most two UMaterialParameterCollection assets; exceeding this produces a compile error. Each collection holds up to 1024 scalar and 1024 vector parameters readable by any material in the project.

Should I use Masked or Translucent blend mode for foliage in Unreal?

Prefer BLEND_Masked for foliage and fences because it uses alpha-test cutout with no sorting or overdraw cost. Reserve BLEND_Translucent for cases where partial transparency is physically required, since large overlapping translucent surfaces stall the GPU.

Does the material instance API change with Substrate in UE 5.8?

No, the C++ instance API including UMaterialInstanceDynamic and all Set*ParameterValue calls is unchanged under Substrate. Substrate only replaces the graph-authoring model with layered slabs and adds Substrate-only shading models and blend modes.