Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bevy Skybox Jittering/Pixelating at Medium/Large Translations #9707

Closed
Braymatter opened this issue Sep 5, 2023 · 0 comments · Fixed by #9909
Closed

Bevy Skybox Jittering/Pixelating at Medium/Large Translations #9707

Braymatter opened this issue Sep 5, 2023 · 0 comments · Fixed by #9909
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior
Milestone

Comments

@Braymatter
Copy link
Contributor

Braymatter commented Sep 5, 2023

Bevy version

0.11.1

Rust 1.70

SystemInfo { os: "Windows 11 Pro", kernel: "22621", cpu: "AMD Ryzen Threadripper 3960X 24-Core Processor", core_count: "24", memory: "127.9 GiB" }
AdapterInfo { name: "NVIDIA GeForce RTX 4080", vendor: 4318, device: 9988, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "536.99", backend: Vulkan }

What you did

When adding a skybox to a camera, and translating the camera more than ~500 units, the skybox starts to jitter an pixelate; severely after about 2000 units.

What went wrong

The skybox starts to jitter and pixelate, severely after being translated about 2000 units.

Additional information

This likely seems in part an issue with float precision.

Repro example:

https://github.com/BraymatterOrg/skybox_pixeljitter_repro

Original Help Thread:

https://discord.com/channels/691052431525675048/1148675054402555935

@Braymatter Braymatter added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Sep 5, 2023
@Selene-Amanita Selene-Amanita added A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Sep 5, 2023
@JMS55 JMS55 added this to the 0.12 milestone Sep 6, 2023
github-merge-queue bot pushed a commit that referenced this issue Sep 23, 2023
# Objective

- Fixes #9707 

## Solution

- At large translations (a few thousand units), the precision of
calculating the ray direction from the fragment world position and
camera world position seems to break down. Sampling the cubemap only
needs the ray direction. As such we can use the view space fragment
position, normalise it, rotate it to world space, and use that.

---

## Changelog

- Fixed: Jittery skybox at large translations.
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this issue Jan 9, 2024
# Objective

- Fixes bevyengine#9707 

## Solution

- At large translations (a few thousand units), the precision of
calculating the ray direction from the fragment world position and
camera world position seems to break down. Sampling the cubemap only
needs the ray direction. As such we can use the view space fragment
position, normalise it, rotate it to world space, and use that.

---

## Changelog

- Fixed: Jittery skybox at large translations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants