bevyengine / bevyengine/bevy

Allow decals to only affect meshes on the same render layer

Open
#19,607 3 comments 2 reactions 0 assignees View on GitHub
A-Rendering C-Feature D-Modest S-Ready-For-Implementation X-Uncontroversial
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

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.

Contributor guide

Open the contributing guide

Research direction

Start by tracing Bevy's decal rendering path and its RenderLayers handling, focusing on how decals select meshes within their volume. Determine how shared RenderLayers bits could constrain projection, then verify that decals affect only matching-layer meshes without breaking existing decal behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.