bevyengine / bevyengine/bevy

Viewport camera clears the whole window

Open
#9,340 1 comment 1 reaction 0 assignees View on GitHub
A-Rendering C-Bug
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## Bevy version

0.11

## \[Optional\] Relevant system information
```
AdapterInfo {
name: "NVIDIA GeForce RTX 2060",
vendor: 4318,
device: 7944,
device_type: DiscreteGpu,
driver: "NVIDIA",
driver_info: "536.40",
backend: Vulkan
}
```

## What you did

Creating two cameras; a viewport camera being drawn after a main one that rendered to the full window. I set the clear color of the camera with the viewport setting expecting it to clear only its viewport area of the window.

## What went wrong

The whole window was cleared, even though the scene is limited to the viewport.

## Additional information
The documentation does not mention that you must set the viewport cameras to ClearColorConfig::None, so I presume this isn't the expected behavior.
https://docs.rs/bevy/latest/bevy/render/camera/struct.Viewport.html

Minimal reproduction:
[bevy_viewport_clear.zip](https://github.com/bevyengine/bevy/files/12243078/bevy_viewport_clear.zip)

Contributor guide

Open the contributing guide

Research direction

Start by running the linked minimal reproduction with Bevy 0.11, then read the Viewport documentation and the camera clear-color behavior it demonstrates. Confirm whether a viewport camera is expected to clear only its viewport or requires ClearColorConfig::None; done means the behavior and documentation agree for the reproduction.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.