URP - Decal feature - Use Rendering Layers set to True causes a black render on WebGL

As the title says, enabling Use Rendering Layers results in a fully black render in WebGL.
This could be caused by my rather specific setup too.
I have 2 renderers, 1 for world and 1 for player.

Renderers

Adding the Decal feature to the world renderer, setting the Technique to Screen Space and enabling Use Rendering Layers causes world render to be fully black.

Result

Simply disabling this option fully fixes the issue, with the downside of, if I am not mistaken, decals being applied to all the layers and not just the world.

Fix

This has an easy fix of its own, simply render decals to a different render layer.

Decal Layer Filtering Fix
  1. Create a new Rendering Layer
  2. Make the Decal Projector use it
  3. Now the painful part, make every single Mesh Renderer you want to have decals use this layer too(I already filed a feature request for defining the default selection of Rendering Layers but I highly doubt we’ll ever see that)

Additional info:
Unity Version - 6000.0.34f1
Browser - Firefox
Similar Issue
Automate Setting Mesh Render Layers

4 Likes

Can you send a repo so I can take a look at it?

Of course, just make sure to clone with --recurse:
git clone --recurse https://www.github.com/NNStdios/GJ

After cloning, if you want to experience the issue, navigate to the Assets/PCRenderer and enable the Use Rendering Layers option under Decal.

1 Like