bevyengine / bevyengine/bevy

SSAO+SSR produces shadow artifacts.

Open
#18,986 0 comments 0 reactions 0 assignees View on GitHub
A-Rendering C-Bug S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## Bevy version

The release number or commit hash of the version you're using.
Bevy 0.16

## What you did

I've provided a reproduction project which is a modified version of the official ssao.rs example.
Adding the Exposure component with field `ev100` as const `EV100_SUNLIGHT` to the camera. The modified example also adds screen space reflections. It also spawns a point light with a high intensity to remain visible in EV100_SUNLIGHT exposure and more cubes to form a square floor. Lastly camera controls.

## What went wrong
The repro project produces shadow artifacts. I've provided a screenshot where you see one side has a nicely rounded shadow whereas the other half is precisely cut off at an angle. It is not related to the fact that multiple cubes make up a floor, using a single floor cube floor mesh causes the same artifact (its added in the repro project but commented out by default)

![Image](https://github.com/user-attachments/assets/9a676be1-d2c6-4aea-8e09-149f96738be3)

## Additional information

Repro project: [ssao_ssr_bug.zip](https://github.com/user-attachments/files/19965960/ssao_ssr_bug.zip)

[And here is an example](https://youtu.be/NFr2gm1uxQ8) of this super awesome and performant SSAO + SSR producing a huge artifact in my gridmap based 3d project. The video shows what I believe to be the results of the artifact produced in the repro project in a big scene with multiple point lights and a directional light. As you can see half of the light in the video is also somehow cut in half and dark, just like on the gridmap floor in the repro example. Disabling SSAO or SSR individually eliminates the artifacts entirely. My project uses ev100 set to 18.0 with an `AmbientLight` at a low intensity to produce an artistic color touch. With ev100 set to near outdoor value I still have super dark spots in unlit areas which is what I want for gameplay purposes. I tried setting camera exposure to default and removing AmbientLight to still reach dark unlit areas (sacrificing artistic touch), but similar shadow artifacts persisted after tweaking the point lights and directional lights to desirable values. I do not believe this artifacting is related to high exposure cameras only.

Contributor guide

Open the contributing guide

Research direction

Run the attached ssao_ssr_bug.zip reproduction based on the official ssao.rs example with Bevy 0.16. Toggle SSAO and SSR individually to confirm that each removes the artifact, then compare the combined result with the reported screenshot and video. Done means the cut-off shadow artifacts no longer appear when both effects are enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev
Issue type
Bug
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.