Welcome to SkinFlow! This system is designed to provide a modular, performant, and robust solution to one of Unreal Engine's most significant challenges: painting on skinned (skeletal) meshes at runtime.

What is SkinFlow?

SkinFlow is a complete solution for applying persistent damage masks (like holes, burns, or dirt) and dynamic, physics-based liquid effects (like blood drips) directly onto moving characters in real-time. It achieves this by bypassing the engine's native limitations through a series of advanced Render Target and Scene Capture techniques.

Core Philosophy

The system is built on two key principles: Modularity and Performance.

How It Works: The 3D-to-2D Pipeline

At its core, SkinFlow translates 3D world-space interactions into 2D texture masks that are then applied back to the character's material.

unreal-engine-mesh-paint-unwrap.gif

The process can be broken down into these key steps:

  1. Input & Raycast: A Line Trace determines the precise 3D location of an impact on the character's Physical Asset.

  2. Scene Capture & UV Projection: The BP_CaptureManager temporarily overrides the character's material with a special M_Unwrap shader. This shader uses World Position Offset (WPO) to flatten the 3D mesh into a 2D plane based on its UV Channel 1 layout. The Scene Capture component then renders this flattened view.

  3. Render Target Masks: The captured image, which contains the "painted" brush stroke, is drawn additively into a Render Target (RT). This RT acts as a persistent mask that stores all damage information.

    unreal-engine-mesh-paint-spheremask.gif

  4. Niagara Drip Simulation: A highly optimized Niagara GPU system (NS_ParticleBuffer) spawns particles all over the mesh randomly, the we use the Mask to act as a “Delete every particle that is not in the painted area”. These particles traverse the 3D mesh surface and write their world positions into a separate, highly efficient 1D Render Target (RT_ParticleDataBuffer).

{8E1707E5-A2DE-43FB-9832-2ED29FF00B37}.png

  1. Material Application: The character's main material reads from these Render Targets. The damage mask (RT_ImpactMask) is used to apply visual effects and geometric deformation (WPO), while the drip mask (RT_CurrentDripMask) is used to render the flowing liquid effect.

Before You Begin

Before attempting to implement SkinFlow, it is critical that you follow the steps in the