Dynamic Palette System Documentation

Introduction

The Dynamic Palette System provides an intuitive way to either switch between multiple Material Parameter Collections (MPCs) directly inside the editor or smoothly interpolate their values in real-time during gameplay. Whether you're designing smooth day-night cycles, creating dramatic weather effects, adding dynamic color transitions, or simply switching between different palettes to instantly achieve a new look, this tool empowers you to elevate your level design without complex coding.

This plugin is recommended to use with the Core Interaction System free plugin available on Fab.

Palette Switcher

The PaletteSwitcher actor is the core component of the Dynamic Palette System. It allows you to manage transitions between two or more Material Parameter Collections (MPCs). By defining MPC_Master and MPC_CurrentPalette, you can adjust values directly in the editor or interpolate them dynamically during gameplay. This flexibility lets you instantly change the entire look of your scene or smoothly blend between various visual states.

DynamicPaletteSystem
Dynamic Palette System in action.

Setup Instructions

  1. Add a Palette Switcher actor to your world.
  2. Assign an MPC_Master, which is the MPC used by your materials.
  3. Assign an MPC_CurrentPalette to define the currently active set of parameters.
  4. Switch to a different MPC_CurrentPalette in the editor to use another set of parameters.
  5. Use the Blueprint functions (e.g. SwitchPaletteInGame) to change palettes dynamically in real-time during gameplay.

Functions

  • SwitchPaletteInGame(UMaterialParameterCollection* To = nullptr, float Speed = -1.0f, TEnumAsByte<EDPSInterpolationType::Type> InterpType = EDPSInterpolationType::Scaled): Smoothly interpolates to the specified palette in real-time.
    • To: The target MPC to switch to. If nullptr, the system will rely on the currently assigned MPC_NextPallete.
    • Speed: The interpolation speed. If -1.0f, uses the global SwitchSpeed property.
    • InterpType: The interpolation type. If not specified, it defaults to EDPSInterpolationType::Scaled or uses the global InterpolationType property.
  • OnPaletteSwitchStarted: Event triggered when a palette switch begins.
  • OnPaletteSwitchUpdating: Event triggered during the palette switch, useful for syncing dynamic elements like sound or lighting.
  • OnPaletteSwitchFinished: Event triggered when the palette switch completes.

Properties

  • MPC_Master: The primary MPC used by your materials as a reference for transitions.
  • MPC_CurrentPalette: The currently active MPC controlling your parameters at any given time.
  • MPC_NextPallete: When interpolating, this is the MPC that it iterpolates to.
  • SwitchSpeed (float): The global speed of palette interpolation used when Speed in SwitchPaletteInGame is set to -1.0f.
  • InterpolationType (TEnumAsByte<EDPSInterpolationType::Type>): The global interpolation type used if not specified in SwitchPaletteInGame.

Use Cases

The Dynamic Palette System allows you to define and switch between different palettes within your Material Parameter Collections (MPCs). Whether fine-tuning visuals directly in the editor or updating them on the fly during gameplay, these scenarios demonstrate the flexibility and simplicity of the system.

Editor-Based Palette Switching

Quickly change between predefined palettes right in the editor. Adjust overall look and feel by simply switching MPCs, allowing you to preview different color schemes or lighting setups without needing to run the game.

Editor-Based Transitions
Instantly switch between palettes in the editor to preview different visual styles.

Day-Night Cycle

Smoothly transition from a bright, warm daytime palette to a cool, subdued nighttime palette. By interpolating between two MPCs, you can achieve a gradual and natural shift in your scene’s overall appearance.

Day-Night Cycle
A GIF showing a simple transition from a daytime palette to a nighttime palette.

Quick Lighting Changes (GIF)

Trigger sudden changes in brightness and color to simulate quick, dramatic effects like lightning flashes. Instantly switch from one MPC to another and back again, adding impactful visual moments to your gameplay.

Thunder Effects
A GIF demonstrating a rapid palette switch to create a lightning-like flash.