In game graphics, the "Decal" function, which allows you to easily add details such as footprints on the ground, bullet holes on the wall, stains and cracks on concrete, to the scene is extremely important in improving the realism of the background. In Unity's Universal Render Pipeline (URP), by using the "URP Decal Projector" component, you can paste graphics into any shape using a projection object (projector) without directly transforming the 3D mesh. However, even though you have placed a decal in a scene and the object fits neatly within the bounding box, have you ever encountered display problems such as ``For some reason, bullet holes are not displayed at all on the ground'' or ``Decals are not displayed only on certain objects or characters''? In this article, we will explain the root cause of this decal drawing bug using the analogy of "stamps and water-repellent coatings," and provide detailed solution steps and a settings checklist that will definitely be useful in practice.
1. Understand with an analogy: ``A water-repellent coated wall and a stamp that doesn't hold ink.''
To intuitively understand this bug where decals are not projected, let's use the analogy of ``A worker trying to put an ink stamp (decal) on a wall.''
You are trying to put a "graffiti stamp (decal)" on a wall (3D object). However, no matter how hard I press the stamp, no ink will get on the wall. Upon closer inspection, I discovered two problems.
The first problem is that workers did not bring an ink stand (Decal Renderer Feature) to the site to stamp. Since there is no ink pad, the rubber stamp (Projector) is dry and is being pressed onto the wall.
The second problem is that the wall surface has a strong water-repellent coating (Receive Decals = Off). Even if you put a lot of ink on it and stamp it, the wall will completely soak up the ink and nothing will remain. Unless you remove this water-repellent coat, no matter how strong you make the stamp, it will be of no use.
This is the true nature of 'projection failure bug' in URP Decal. You need to activate the ability to draw decals system-wide, and also give permission to the projected mesh material to "receive decals."
2. Root cause: unregistered renderer feature and material water repellency settings
The decal projection process in URP is performed in a custom render pass (DBuffer pass or Screen Space pass) via a dedicated "Renderer Feature", unlike the traditional Built-in pipeline. The technical causes can be summarized into the following three.
Cause 1: Decal Feature is not registered in Universal Renderer Data
URP requires running a dedicated path for compositing decals in addition to the standard opaque/transparent drawing paths. The `Decal` Renderer Feature specifies this path. If this is not registered, all `Decal Projectors` in the scene will skip the drawing calculation itself and will not function.
Cause 2: "Receive Decals" of the projection material is turned off.
For performance optimization, URP materials (Lit, etc.) have a flag to determine whether or not to receive decals individually. When importing a ground or wall prefab or creating a new custom material, if this flag is initially set to OFF, the decal will not be projected at all even if it is within the range of the decal projector.
Cause 3: Compatibility mismatch between drawing method (Decal Technique) and platform
There are two types of URP decals: `DBuffer` (a high-quality method that uses a decal buffer) and `Screen Space` (a lightweight method that synthesizes on the screen from depth and normals). WebGL and some older mobile devices do not support DBuffer, and misconfigured settings can cause decals to turn black or disappear.
3. Step-by-step procedure for solution
Step 1: Add "Decal" to Universal Renderer Data
- Select the Universal Renderer Data asset (usually named something like `UniversalRP-HighQuality-Renderer`) in your project.
- Click the Add Renderer Feature button at the bottom of the inspector.
- Select and add Decal from the list.
- Check the Technique in the added `Decal` inspector. DBuffer is recommended for PC/console. For mobile and Quest, please consider Screen Space, which has a lower load.
Step 2: Change the material settings of the projection destination asset
- Select the material of the object (e.g. concrete wall or ground mesh) on which you want to project the decal.
- Expand Advanced Options (or `Surface Options`) near the bottom of the material's inspector.
- Set the checkbox for Receive Decals to ON (enable).
Step 3: Resolving the overlapping order of decals (Z-Fighting)
Adjust the Draw Order property of the `Decal Projector` component to prevent the flickering phenomenon (Z-Fighting) when bullet holes overlap with footprints. Decals with larger numbers are drawn closer to the front.
// Decal for footprints (background/base)
[Decal Projector] -> Draw Order: 0
// Decal for bullet holes (front/on top)
[Decal Projector] -> Draw Order: 5 (sort to the front with a larger value)
4. Practical checklist and recommended settings table
| Target environment | Recommended Technique | Advantages | Notes/Disadvantages |
|---|---|---|---|
| PC / Console (PS5, Xbox) | DBuffer | Lighting and normal map blend in beautifully. high quality. | Slightly increases VRAM consumption. Note on mobile compatibility. |
| Mobile / Meta Quest / WebGL | Screen Space | No additional buffer required and very lightweight. Works on almost all devices. | Lighting has limited familiarity and is sensitive to normal changes. |