Easy Decal

About Easy Decal – Unity Editor Tool & Plugin

Easy Decal Unity Asset Overview

The Easy Decal architecture provides a procedural projection workflow designed to apply surface details—such as impact marks, dirt patterns, signs, and environmental wear—onto arbitrary target geometry without modifying base mesh textures. The asset operates primarily via dynamic mesh generation and screen-space/projector shader passes, providing versatility across varying rendering configurations in Unity.

Runtime Mesh Generation vs. Projected Decals

At its core, Easy Decal constructs localized dynamic decals by querying underlying surface geometry via raycasts or volume overlaps. When a decal impact point is calculated, the system evaluates target vertex buffers and clips the decal bounds against the intersecting geometry. This process generates an optimized mesh payload aligned precisely to the recipient's surface normals, preventing z-fighting using customizable depth offsets.

From an engine performance perspective, dynamic mesh generation incurs a minor CPU burden during the initialization frame. However, once constructed, the decal mesh behaves as standard static or parented render geometry. This approach es the heavy fragment shader overdraw often associated with screen-space deferred decals, making it highly viable for complex mobile or VR rendering pipelines.

GC Allocations & IL2CPP Optimization

dynamic runtime allocations can severely degrade frame stability through frequent Garbage Collection (GC) spikes. Easy Decal addresses this by utilizing pre-allocated vertex array buffers during clipping computations. To ensure minimal overhead when executing under IL2CPP compilation:

Inspector Configuration & Workflow

The system extends the Unity Editor through dedicated property drawers and custom gizmo manipulators attached to the EasyDecal component. This allows game designers to manipulate spatial projections directly within the Scene View with real-time feedback.

Custom Property Drawers & Alignment Tools

The custom Inspector exposes precise spatial control mechanisms. Key properties available within the component view include:

In-editor placement handles permit rapid rotation, scale adjustment, and surface projection snapping via custom editor scripting, eliminating the need to manually compute normal orientation vectors in the transform inspector.

Quick-Start Unity Integration Guide

Setting up Easy Decal involves configuring a target material, defining an atlas configuration (optional but recommended), and driving dynamic instantiation via runtime C# triggers.

Step 1: Setting Up the Decal Prefab

  1. Create a standard GameObject in your scene hierarchy and attach the EasyDecal component.
  2. Assign your designated decal Material (utilizing a transparent cutout, additive, or specialized decal shader).
  3. Adjust the Decal Bounds box gizmo to define the maximum projection volume width, height, and depth.
  4. Save the configured object into your project assets as a reusable Prefab.

Step 2: Dynamic Spawner Script Implementation

The following C# script demonstrates how to instantiate and align dynamic decals programmatically upon surface impact, using efficient physics queries and orientation logic:

using UnityEngine;
using ch.sbb.deki; // Default namespace reference for EasyDecal API calls

public class DecalImpactSpawner : MonoBehaviour
{
    [SerializeField] private GameObject decalPrefab;
    [SerializeField] private LayerMask decalableLayers;
    [SerializeField] private float maxDistance = 100f;

    private void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            PerformRaycastDecal();
        }
    }

    private void PerformRaycastDecal()
    {
        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        
        if (Physics.Raycast(ray, out RaycastHit hit, maxDistance, decalableLayers))
        {
            // Instantiate decal at hit position oriented toward the surface normal
            Quaternion decalRotation = Quaternion.LookRotation(-hit.normal);
            GameObject decalInstance = Instantiate(decalPrefab, hit.point, decalRotation);

            // Access the EasyDecal component to programmatically initialize bounds or parent target
            EasyDecal decalComponent = decalInstance.GetComponent<EasyDecal>();
            if (decalComponent != null)
            {
                // Parent decal to target object if moving (e.g. vehicles, dynamic doors)
                decalInstance.transform.SetParent(hit.collider.transform, true);
                
                // Force instant dynamic mesh projection against intersected target geometry
                decalComponent.UpdateDecal();
            }
        }
    }
}

Performance Profiling & Optimization Matrix

Maintaining high frame rates across low-end mobile hardware or desktop configurations requires balancing mesh complexity against draw call bottlenecks. Below is an architectural overview of performance characteristics when leveraging Easy Decal.

CPU vs. GPU Bottleneck Analysis

Because static mesh decals generate actual vertex indices, GPU rasterization overhead is minimal compared to screen-space screen-buffer projections. However, high-density target meshes (e.g., photogrammetry terrain or dense environment props) increase CPU runtime projection work. Utilizing UV atlases combined with Unity's GPU Instancing allows dozens of identical dynamic decal instances to be merged into single render calls.

Technical Pros & Cons

Asset Details & Specifications

CategoryTools / Utilities
Latest Versionv2021.4.1 (2 tracked releases)
File Size404.18 MB
Added to PlatformFebruary 5, 2026
Views10 views
Downloads0 downloads
Favourites0 favourites
Official StoreBuy Original License on Unity Asset Store →
Issue with Package?Report Broken Link →

Related Unity Tools Assets