Decals Don't Work In Build

This is for Unity 2021.2.0b16 (the latest beta) and also present in 2021.2.0b6, when I export my game the decals are not visible.

Here’s the scene view:


The game view:


And the build:


No decals! Huh.

There’s two decals in the scene because one uses the stock URP Decal shader graph, and the other is just a straight copy-and-paste of the URP Decal shader graph into my /Assets/ folder. Clearly, it doesn’t really make a difference which shader graph source is used.

Is the Decal shader getting erroneously stripped? Here’s my Graphics project panel:

I have ‘Strip All’ variants set, but that shouldn’t mean the Decal shader graph gets missed.

In an effort to try and ‘force’ the Decal shaders to get built, I added it to a Shader Varient asset you can see preloaded above, where the shader graphs are clearly listed:

7594351--941959--ShaderVarients.png

Something’s very wrong here. I’m going to file a bug and update this thread with the issue number when I have it.

The bug issue number is: 1375187

I got a helpful reply back from Edvinas on the Unity QA team. It turns out that if you have GPU instancing set on the Decal material, the Decal shader is entirely stripped when you have ‘Strip All’ set in the Instancing Variants player settings, which is not behaviour I’ve come across for any other URP shader.

The docs for the Decal renderer say:

The docs should probably also mention in the same section that ‘Strip All’ + Enable GPU Instancing aren’t supported.

2 Likes

Problem persists in 2021.2.12f1 - even with GPU instancing disabled on decal materials.

Was it fixed in 2021.3.0 ?

Can’t get decals working on builds in 2021.3.0 so probably not

Actually it works for me in 2021.3 builds, but LTS got other big issues

What platform? They don’t work for me on Android w OpenGL 3.

Ah! Sorry to hear that, it works for me on Windows with DirectX, but I hear 2021.3 had numerous problems with mobile

1 Like

Doesn’t work for me in 2021.3.0

Little rant:
Unity seems to introduce more and more features and most of them feel unfinished. So many open ends, missing functionality and bugs. It’s extremely cumbersome to work with for bigger projects, especially since upgrading to another version might fix some problems, but will also introduce a whole bunch of new problems, sometimes even breaking stuff that worked before. I might switch to Unreal for my next project after 8 years of Unity development.

5 Likes

I feel ya. When I dropped in decals to our recent project, the first thing I noticed is there was no way to limit what they go on. Such a basic feature! I ended up adding it in myself haha.

I think all these recent screwups are being reflected in their stock price. Hopefully someone over there realizes they’re focusing on the wrong things and pivot. They need a GAME engine, not a screenshot engine. If GAMES are not being released on unity’s tech, then what is the point of making all this new stuff?

They need to ensure people can make games with the tools they use. They need to ensure things are stable. They need things to be reliable. Unity just needs to make games, honestly.

3 Likes

2021.3 lts and still happens.

ironic, cuz in 2021.1 i managed to fix it myself, but mostly by accident.

Taking that they know the problem is just the variant being stripped, then it’s just a matter of disabling “Strip All”, and manage them manually

and carefully i guessTo clarify, the previous bug with decals was that it ignored the scaling of the screen, making the “Screen Resolution” feature unusable.

Forcing you to use a rendertexture

my setting was on “Strip Unused” … imma go graba bite and “ASSUME” it works now :slight_smile:

NO.

This is indeed a NEW bug, stripping works as intended.

The problem is that older devices just do not render decals.

Which is wierd, as screenspace should be the more performant option.

My old phone is a HuAwei p9.

No one is gonna play on it realistically speaking … but it was. good flex to make it run at +40 fps while updating the entire screen with meshes

too bad … potato mode it is for them, so at least I can gain even more performance by disabling the depht pass and decas completely … those are half a millisecond combined, so the savings are pretty huge!

Im on 2021.3.20 and compiled different methods of fixing this issue from different forums and built in WebGL 7 seperate times, and nothing seems to work. This is upsetting because my environment relies on URP Decals for it’s narrative (my game is inside a cave and i used decals to make some cave paintings that told a story). I have to be limited on my local build and put my project in my portfolio by screen-recording my playthrough, while it could have been accessible for everyone to play if it weren’t for this bug. :confused:

If anyone has any last-resort suggestions don’t hesitate

Hi, is the decal mode set to “DBuffer”? It doesn’t support OpenGL backends, so you may try using “Screen Space” mode for WebGL 2 instead.

You should also disable decal layers (or light layers, rendering layers) because they’re not supported on OpenGL backends too.

if it still doesn’t work, have you tried other decal solutions like driven-decals (pre-generated static mesh decals)?

I cannot get any decals working in my build on 2022.3.3 for URP; they work perfectly fine in play mode.

I’ve tried all stripping options and GPU instancing combinations.

How is this a finished released feature? Anyone have further suggestions?

Check if you are using the same Quality settings, in URP, there might be build settings for different platforms, and you chose support in one setting, but did not in another. Also in DX11 it works fine when stripping is removed. So it is shader stripping problem.

Try setting the graphics to use Vulkan instead of OpenGL , this fixed it for us.

1 Like

I found the issue and posted more info here, but the short of it is, in the render feature “Technique” is set to auto, in build it must be defaulting to “screenspace” when “dbuffer” is whats used in editor.

1 Like