Runtime Vertex Color Paint and Detection Plugin

About

A Plugin that allows the user to Paint & Detect Vertex Colors in Runtime in various ways which can enable audio-visual fidelity as well as new game mode and gameplay possibilities without the need to have a C++ Project with alterations to the Source. 

Built almost entirely in C++ with Exposed Functions and Events to Blueprint so even users in Blueprint only projects can utilize the plugin to the fullest. 

Has Multithreading Support so the user can Paint/Detect on really heavy Meshes with several LODs. 

The Plugin has 2 Main Modules, the actual Runtime Paint/Detect Module, and an Editor Module that handles all the Editor Logic using an Editor Subsystem with an Editor Utility Widget, such as Storing Vertex Data, Storing, Previewing and Updating Color Snippets, Registering Physics Surfaces for a Material etc. 

The Plugin also uses Engine, World and Game Instance Subsystems to great affect as the users doesn't have to do anything but enable the plugin for them to run so we can utilize them very comfortable to run logic such as Applying Colors or Caching relevant Level Data Assets. 

 
 

Detect Vertex Data

Detect to get Data of the Closest Vertex of the Location which includes Color, Position and Normal of the Vertex, as well as EPhysicsSurface if the user has registered the Material and what surfaces is on each of the color channels. 

Loops through the Vertices of LOD0 to get the closest Vertex. If Skeletal Mesh, then it only loops through the vertices of the section to make it more optimized. 

Detect On Location
Detect On Location

press to zoom
Detect On Location
Detect On Location

press to zoom
1/1

Detect At Location

Detect Get All Colors
Detect Get All Colors

press to zoom
Detect Get All Colors
Detect Get All Colors

press to zoom
1/1

Get All Colors of Mesh or Bone to check % which can be used for Splaboon like Game Mode or just to check if a Bone has been painted over a certain amount.

For example a Enemy that can get one of their Legs frozen by the player, if over a certain amount then maybe it should break. 

Detect - Get All Colors

Register Materials with what Physics Surface is on each of the Vertex Color Channels so you can get this in Native EPhysicsSurface when Detecting.

You also get it as String Type, with float values on how much is painted on each surface, which can be used to blend VFX or SFX in UE4 or Third Party Programs like WWise with their RTCPs that uses Strings. 

Set Physics Surfaces
Set Physics Surfaces

press to zoom
Detect On Physics Surface
Detect On Physics Surface

press to zoom
Set Physics Surfaces
Set Physics Surfaces

press to zoom
1/2

Get Native EPhysicsSurface

Fire Example - Combines Paint at Location & Detection

 

Paint At Location

Paint At Location - Ice
Paint At Location - Ice

press to zoom
Paint At Location surface
Paint At Location surface

press to zoom
Paint At Location - Ice
Paint At Location - Ice

press to zoom
1/2

Paint At Location with Area of Effect and Falloff. Probably the paint type that will be just most often and can be used to create game modes and gameplay mechanics, or just nice attention to detail.

Ice, Snow and Cracks in Ice on Different Channels

Combine with Particle Collisions for added Fidelity. 

Can opt to run Detection before and/or after the Paint job so you can run logic based off of how it looked like before the Paint Job, for example if Rain lands on a Dry Cap, it should make a sound different from when it's dry, compared to after the drop has made it Wet. 

Echo in Shower
Echo in Shower

press to zoom
Paint At Location - Lena Walking through Rain
Paint At Location - Lena Walking through Rain

press to zoom
Echo in Shower
Echo in Shower

press to zoom
1/2

Combine with Particle Collisions

 

Paint Within Area

Paint Within Area Lena Lake
Paint Within Area Lena Lake

press to zoom
Paint Within Area Splaboon
Paint Within Area Splaboon

press to zoom
Paint Within Area Lena Lake
Paint Within Area Lena Lake

press to zoom
1/2

Paint Within Area will paint the part of the Mesh that is overlapping the Area. 
Cube, Rectangle & Sphere Shape is the Cheapest. They also Support Extra Extent where we can Apply Colors outside of the area as well, which is useful if a characters clothes should soak up water if they're standing in a lake or if there are waves. 

Paint Within Area - Cube/Rectangle Shape

Support Complex Shapes as well such as Skeletal Meshes. 
This is more expensive but makes it possible to paint with the shape of a skeletal mesh or static meshes that have any kind of shape. 

Paint Within Area Complex
Paint Within Area Complex

press to zoom
Paint Within Area Complex 2
Paint Within Area Complex 2

press to zoom
Paint Within Area Complex
Paint Within Area Complex

press to zoom
1/2

Paint Within Area - Complex Shape

 

Paint Entire Mesh

Paint Entire Mesh - Add
Paint Entire Mesh - Add

press to zoom
Paint Entire Mesh - Set
Paint Entire Mesh - Set

press to zoom
Paint Entire Mesh - Add
Paint Entire Mesh - Add

press to zoom
1/2

Paint Entire Mesh can either Add or Set the entire mesh to be a Color. 
This can be very useful if you're spawning Meshes which default colors is undesirable and you want to clean them. 
Also if you for instance want to Dry your character if they're wet where you can Paint Entire Mesh with Add, and set to - the color on a channel. 

Paint Entire Mesh

 

Paint Color Snippets

Create and Store Color Snippets which can be Painted in Runtime
This can be very useful if you want to store exactly how you want your character to look in a level or cinematic, or if you want to make several different variations of zombies with wounds and blood etc. 

You can Preview a Created Snippet and Update the Colors if you want to make changes. 

Through VertexPaintEngSubsystem->GetAllAvailableColorSnippetsOnMesh (which can also be called through BP) you can get them all which is useful if you want to spawn a zombie and just randomize which snippet it should get. 

Paint Color Snippets
Paint Color Snippets

press to zoom
Paint Color Snippets - Menu
Paint Color Snippets - Menu

press to zoom
Paint Color Snippets
Paint Color Snippets

press to zoom
1/2
 

Painting on Cloth

Paint on Cloth Echo and UE4 Char
Paint on Cloth Echo and UE4 Char

press to zoom
Paint on Cloth Echo and UE4 Char
Paint on Cloth Echo and UE4 Char

press to zoom
1/1

The Plugin Supports Painting on Skeletal Meshes Simulated Cloth.
Since Hair can also be Cloth it can also get painted if setup correctly. 

In UE5 we can also change the Cloths Physics with the new Chaos Cloth System, which means we can make Capes or Hair etc. Heavier if they for example become Wet. 

Painting Cloth Wet weighs them down

Features Cloth Overlap Component
The Plugin has a Scene Component that when placed under Skeletal Mesh Component with Simulated Cloth, can trace on the cloth for overlaps. Which means even if the cloth itself is for example overlapping a Waterfall Mesh, the Cloth can start to get painted. 
Otherwise the Skeletal Mesh itself would have to overlap with it. 

Paint on Cloth - Cloht Overlap Comp
Paint on Cloth - Cloht Overlap Comp

press to zoom
Paint on Cloth - Cloht Overlap Comp
Paint on Cloth - Cloht Overlap Comp

press to zoom
1/1

Cloth itself Detects the Overlap

The Utility Widget

Editor Widget.png

Through the Editor Utility Widget the Developer can manage all Editor Settings regarding the Plugin.
Such as Storing Level Vertex Data, Adding Snippets, Registering Physics Surfaces and Setting Optimizations. 
It does so through an Editor Subsystem that has those functions. 

You can read more about the Widget and the settings you can make in Detail in the Documentation Here