bevyengine / bevyengine/bevy

SSR samples depth with linear sampler, which is poorly supported

Open
#23,965 2 comments 0 reactions 0 assignees View on GitHub
A-Rendering C-Bug S-Ready-For-Implementation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
4d 8m
Merged PRs (30d)
147

Description

## Bevy version and features

main

## What went wrong

SSR uses linear sampler for depth texture on native platforms:

https://github.com/bevyengine/bevy/blob/90b41543e2d0eadd94b52d99f184aa319f1de2e8/crates/bevy_pbr/src/ssr/mod.rs#L581-L582

https://github.com/bevyengine/bevy/blob/90b41543e2d0eadd94b52d99f184aa319f1de2e8/crates/bevy_pbr/src/ssr/raymarch.wgsl#L35-L37

WebGPU disallows it because it's poorly supported on native platforms: https://github.com/gpuweb/gpuweb/discussions/5151#discussioncomment-12795978

This is also a wgpu bug that it's not validated https://github.com/gfx-rs/wgpu/issues/8513

So we should manually sample depth to emulate linear filtering on native platforms as well as webgpu.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.