Description
What problem does this solve or what need does it fill?
Currently, decals in Bevy affect all meshes within their volume, with no way to control which meshes receive the projection. This can cause unwanted visual artifacts — for example, when the player walks near a wall with graffiti, blood, or bullet hole decals, those decals appear on the player's body as well.
There is no way to prevent this behavior in the current system. I tried separating the affected and unaffected meshes using different RenderLayers
, but decals still affect all meshes inside their volume regardless of layer.
What solution would you like?
Ideally, decals should only affect meshes that share at least one RenderLayers
bit with the decal itself. For example, a decal with RenderLayers::layer(1)
should only project onto meshes that also have RenderLayers::layer(1)
. This would give developers precise control over which meshes can receive decals and help avoid unintended projection onto characters or other dynamic objects.
I’m not very familiar with Bevy’s rendering internals, so I’m not sure if this is feasible or if there's a better way to achieve the same effect. I’d greatly appreciate any guidance or discussion on how this kind of control might be supported.