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.
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.
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:
Physics.RaycastNonAlloc and Physics.OverlapBoxNonAlloc primitives.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.
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.
Setting up Easy Decal involves configuring a target material, defining an atlas configuration (optional but recommended), and driving dynamic instantiation via runtime C# triggers.
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();
}
}
}
}
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.
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.
| Category | Tools / Utilities |
|---|---|
| Latest Version | v2021.4.1 (2 tracked releases) |
| File Size | 404.18 MB |
| Added to Platform | February 5, 2026 |
| Views | 10 views |
| Downloads | 0 downloads |
| Favourites | 0 favourites |
| Official Store | Buy Original License on Unity Asset Store → |
| Issue with Package? | Report Broken Link → |