Runtime
Painting, sampling, material copying, player, camera, controls, and user-interface components.
PaintForge lets players paint objects and characters at runtime, sample visible colors, copy reflection and HDR emission, fill or clear targets, and copy complete textured appearances.
Painting, sampling, material copying, player, camera, controls, and user-interface components.
Ready-to-use PaintForge player and paint system objects.
A showcase for color, reflection, emission, and texture copying.
Compatible painting shaders and example materials.
Assets/PaintForge/Samples/Demo/Scenes/PaintForgeShowcase.unity to test all features.Designed for Unity 6 with the Universal Render Pipeline. Add the sample Volume when you need visible HDR bloom.
The player and rebindable controls use Unity's Input System package and UnityEngine.InputSystem.
UV painting needs readable geometry, a valid UV0 channel, and an accurate MeshCollider. Vertex painting needs enough vertices.
Use the supplied compatible materials for painted color, reflection, emission, and texture-copy output.
Play the showcase and verify the controls.
Drag the PaintForge player prefab into your scene.
Add the paint system prefab and assign the gameplay camera.
Add PaintForgeUVPaintable and a suitable collider.
| Input | Action | Usage |
|---|---|---|
| W A S D | Move | Move relative to the camera. |
| Shift | Sprint | Hold while moving. |
| Tab | Color Lab | Open or close the painting UI. |
| LMB | Paint | Paint the target under the cursor. |
| RMB + Drag | Brush size | Change brush radius. |
| Space | Live sample | Hold and move to sample color, reflection, and emission. |
| I | Copy appearance | Copy and immediately apply a complete appearance. |
| F | Fill | Fill the hovered paintable target. |
| C | Clear | Clear the hovered target. |
| 6 / 7 / 8 | Brush mode | Sharp / Soft / Blend. |
| F1 | Help | Show the in-game guide. |
| F2 | Settings | Change controls and player settings. |
UV Render Texture is recommended for detailed props and walls. Skinned characters are supported. Vertex Color quality depends on mesh vertex density.
Hold Space over a source to load its visible color into the brush.
The sampled surface response is used by the next stroke or fill.
Emission strength and HDR color are sampled together to preserve glow.
Aim at a textured source and press I to copy its complete supported appearance.
| Backend | Best for | Needs |
|---|---|---|
| UVRenderTexture | Detailed objects, walls, close views. | Valid UV0, MeshCollider, compatible material. |
| VertexColor | Characters and dense meshes. | Enough vertices and compatible shader. |
| MaterialTint | Simple whole-object color changes. | Supported Renderer color property. |
1024 is a practical starting resolution for UV painting. Use less for distant/mobile targets and more only for important close-up objects.
Configure walking, sprinting, acceleration, air control, rotation, jump, and gravity in the Inspector.
Assign the player target and configure orbit, zoom, sensitivity, and distance.
Add and configure PaintForgeUVPaintable on the player visual to receive paint and copied properties.
Edit defaults on PaintForgePlayerControls. Players can customize supported controls with F2.
Clear Saved User Overrides before testing changed defaults.Paint Camera | Camera used to raycast from the pointer. |
Ray Distance | Maximum target detection distance. |
Brush Mode | Sharp, Soft, or Blend. |
Active Color | Current brush color. |
Stroke Interval | Time between held-paint stamps; lower values are smoother but more expensive. |
Character Paintable | Player fallback used by supported fill/copy actions. |
Backend | UVRenderTexture, VertexColor, or MaterialTint. |
Allow Style Copy | Allows complete appearance copying to this target. |
Paint Mode Enabled | Allows brush strokes. |
Texture Copy Mode Enabled | Allows copied texture appearances. |
Texture Copy Priority | Prioritizes full appearance copy when modes overlap. |
Resolution | Runtime paint texture size; 1024 is the default practical balance. |
Clear Color | Value restored by Clear. |
Paint Composite Material | Compatible material used to display paint and surface channels. |
Paint System connects the interface to the active system. Open On Start controls initial visibility. Wheel Size sets the generated color-wheel size.
Camera Transform, Walk/Sprint Speed, Acceleration, Air Control, Rotation Smooth Time, Allow Jump, Jump Height, Gravity, Grounded Vertical Velocity, keyboard/sprint/jump input toggles.
Target and Target Name; Distance, Height, Look Height and smoothing; orbit sensitivity and pitch limits; minimum/maximum zoom; collision mask, radius, and buffer.
Default movement, interface, painting, brush, and orbit keys plus look sensitivity, zoom sensitivity, and Invert Y. Runtime user choices are saved and take priority.
All core types are in the PaintForge namespace.
| Member | Type | Description |
|---|---|---|
BrushSize | float | Current normalized brush size. |
ActiveColor | Color | Current brush color. |
BrushMode | PaintForgeBrushMode | Sharp, Soft, or Blend. |
BrushOpacity | float | Current stroke opacity. |
BrushHardness | float | Current edge hardness. |
EmissionStrength | float | Active emission amount. |
SetColor(Color color)Changes the active brush color.
SetBrushMode(PaintForgeBrushMode mode)Selects Sharp, Soft, or Blend.
SetBrushSize(float value)Sets normalized brush size and clamps it to 0–1.
SetSurfaceResponse(float reflection, float emission)Changes the surface values carried by new strokes.
StampHovered(Vector2 screenPosition)Paints at the supplied screen coordinate.
FillHovered(Vector2 screenPosition)Fills the paintable under the supplied coordinate.
ClearHovered(Vector2 screenPosition)Clears the paintable under the pointer.
SampleColorHovered(Vector2 screenPosition)Samples visible color.
CopyColorAndSurfaceHovered(Vector2 screenPosition)Samples color, reflection, and emission into the brush.
CopyStyleHovered(Vector2 screenPosition)Copies the supported complete appearance.
TryGetPaintHit(...)Returns true and outputs the target and RaycastHit when a valid paintable is found.
PaintTextureThe current UV paint RenderTexture.
BackendThe configured PaintForgeBackend.
PaintModeEnabledWhether brush painting is enabled.
TextureCopyModeEnabledWhether texture copy is enabled.
SetSurfaceResponse(metallic, smoothness, reflection, emission)Sets base surface response values.
SetStrokeEmissionColor(Color color)Sets the HDR emission color for future strokes.
CopyStyleFrom(Renderer source, bool copyTexture, bool prioritizeTexture = false, bool copySurfaceSettings = false)Copies supported properties from a renderer.
SetFlatCopiedAppearance(Color color, float reflection, float emission, Color emissionColor)Applies a flat copied appearance without a source texture.
Stamp(Vector2 uv, Color color, ...)Low-level UV stroke including opacity, hardness, surface data, world point/radius, and optional stamp texture.
StampVertex(Vector3 worldPoint, Color color, ...)Low-level world-space stroke for VertexColor targets.
Fill(Color color, float reflection = 0, float emission = 0)Fills the complete target.
Clear()Restores the target's clear state.
using PaintForge;
using UnityEngine;
using UnityEngine.InputSystem;
public class PaintAbility : MonoBehaviour
{
[SerializeField] PaintForgeUVPaintSystem paintSystem;
public void SelectRedGlow()
{
paintSystem.SetColor(Color.red);
paintSystem.SetBrushMode(PaintForgeBrushMode.Soft);
paintSystem.SetBrushSize(0.25f);
paintSystem.SetSurfaceResponse(0.15f, 2.0f);
}
public void FillAtCursor()
{
paintSystem.FillHovered(Mouse.current.position.ReadValue());
}
}PaintForgeInputSettings.GetKey(action)Returns the saved key or Inspector/default fallback.
SetKey(action, key)Saves a new key in PlayerPrefs.
IsPressed(action)True while the action key is held.
WasPressedThisFrame(action)True only on the press frame.
LookSensitivity / ZoomSensitivity / InvertYSaved user camera properties.
ResetDefaults()Deletes all saved PaintForge control overrides.
DisplayName(action)Returns a user-facing action name.
RegisterInspectorDefaults(...)Registers prefab defaults used when no user override exists.
using PaintForge;
using UnityEngine.InputSystem;
PaintForgeInputSettings.SetKey(PaintForgeAction.Fill, Key.G);
PaintForgeInputSettings.LookSensitivity = 1.25f;
// Restore package/Inspector defaults:
PaintForgeInputSettings.ResetDefaults();The optional Offline system provides simple whole-renderer color painting with palette, sampling, fill, undo, and clear operations.
ActiveColor / BrushSizeCurrent simple-paint values.
SelectPalette(int index)Selects a configured palette entry.
SetActiveColor(Color color)Sets the simple paint color.
SetBrushSize(float size)Clamps size between 0.05 and 1.
PaintAtScreenPosition(Vector2 position)Paints the OfflinePaintable under a screen point.
FillHovered(Vector2 position)Fills the hovered simple target.
SampleHovered(Vector2 position)Samples its current color.
Undo()Reverts the last simple paint operation.
ClearAllPaint()Resets every tracked OfflinePaintable.
OfflinePaintable.SetPaintColor(Color)Changes one target.
OfflinePaintable.ResetPaint()Restores its default color.
Open Color Lab with Tab, verify the target has PaintForgeUVPaintable and a collider, and check the F2 key assignment.
Use a MeshCollider instead of a BoxCollider and check UV0 for overlap or stretching.
Confirm the cursor hits the intended renderer and the MeshCollider returns the correct texture coordinate.
Use a compatible PaintForge shader and enable Bloom in the URP Volume.
Check its Base Material, Tint, and shader. Remove PaintForgeUVPaintable from architecture that is not intended to be painted.
The cursor hit a non-paintable collider. Add PaintForgeUVPaintable and a matching MeshCollider if that object should receive paint.
Start with the included showcase, then reuse the configured prefabs in your project.