URP Decal Layers?

Being able to exclude meshes from being affected by decals is very important, especially if the targeted decal surface isn’t flat. Is there a way to do that currently in URP and if not, is it a planned feature?

Example below: is it possible to project a decal ONLY onto the terrain?

6 Likes

HDRP have it, but I don’t know if they will implement it also inside the URP. Obviously it’s a must have feature…

Agreed and +1. This is a must have feature indeed.

It’s a complex issue to solve, for HDRP they had to resort to reusing the first 4 light layers iirc.

I agree it’s important, but I wouldn’t expect this to be implemented over night :wink:

Haven’t tried this myself, but it may be possible to use the Render Objects render feature to render a specific layer on top of all the decals.

1 Like

Do URP decals really not have a way to filter which objects receive decals? Seriously? Who thought that would be a good idea? It’s not a very useful system if it doesn’t have this feature. If you were designing a decal system, and thinking of what features it should have, it would say “filter which surfaces it can project on” would be on top of the list.

15 Likes

Hi everybody,

This is not supported yet but the team is planning to add this. I don’t have an ETA to share at this point.

7 Likes

Thanks for update Leonhard!

Can we have an entry for Decal Layers on the URP roadmap

https://portal.productboard.com/unity/1-unity-platform-rendering-visual-effects/tabs/3-universal-render-pipeline

To give us some confidence? Outside of small decals ie blood splats and bullet holes I am not sure what more you could do with this?

I was imagining using for drop/blob shadows, large painted decals on grounds (road symbols etc) or on walls (spray paint/graffiti). These use cases are not possible at all without some way to filter?

Ofcourse this release is better than nothing - it is nice to get an early preview of how the system will work. I would love to see something on the road map about this!

Edit: can we opt out of receiving decals for meshes? Our hero characters renderers can opt out of them and we could get by for now without Layers. I should download and give it a try

1 Like

I’ve notified the team about it and they will look into it. It would also be helpful if you could submit a request for it on the roadmap page.

It is possible to draw the characters after decals, for example by adding them to a specific layer and rendering them with the RenderObjects feature after sky/before transparent.

https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@12.0/manual/renderer-features/how-to-custom-effect-render-objects.html

3 Likes

Request submitted…

I tried your suggestion and it is indeed possible. So we’ve got a workaround for now.

Setup

It was nice to be able to do this without any scripting! Now if only we could filter what is rendered by Rendering Layers and not standard Layers… :slight_smile:

13 Likes

Any update on the progress for this @LeonhardP ?

It is road mapped to be added. It’s also on our public roadmap here if you want to provide feedback on specific use cases you might have so we can have visibility to address them.

3 Likes

With the decal renderer technique of ‘DBuffer’ (or ‘Automatic’), I wasn’t able to get this to work unless I also set the new RenderObjects feature’s event to ‘AfterRenderingPrePasses’. If I used a technique of ‘Screen Space’, then I could set the feature’s event to ‘AfterRenderingSkyBox’.

2 Likes

I found a much simpler work around for this.
If you only want the decals to appear on the floor geometry, but ignore all the geometry above the floor (architecture and characters), all you have to do is change the render queue of the materials.
The render queue determines when the material is going to be drawn by the GPU.
So, say your decal material has a queue of 1800. Every material with a queue below that value will be rendered before. So the decals will show on top of those materials. So, you put everything you want to be affected by decals (all your floor and floor details) with materials with a queue lower than 1800.
Then, everything with a material who’s render queue is above that value (1802, 1803, etc.) will render on top, and so it’ll ignore the decals. So, you put your characters, furniture, arquitecture, etc. with a highter queue than 1800.
You can set the render queue of any material in the inspector. If you don’t see it, you may have to the upper right corner of the inspector, click on the three dots and choose “Debug”. Then it’ll show, and you can later switch back to normal.

1 Like

Wouldn’t changing the rendering order mess up the optimizations that GPU’s have when rendering front to back? With front to back, if a fragment would not be visible because something is already rendered in front of it, the GPU can discard it. By doing it the opposite way, you no longer have that optimization. Whether that way is faster than whatever decal layer method Unity is implementing is something that will have to be seen.

killer feature to use decal for rpg/rts-style worldspace GUI, which affect decoration, but not gamplay-active gameObjects

Any progress on this ?

Any progress on this ?

But really,
Any progress on this ?

Hi,

It’s actively being worked on and the plan is to have something in time for 2022.2. However, things might still change so this is not guaranteed.

Is there a workaround for this issue until that feature is implemented? Because in most situations you wouldn’t want a decal to affect dynamic objects, only static ones like walls and so on.