Commit edde626
authored
Add support for SSR on web (bevyengine#22193)
# Objective
- Implemented WebGPU safe SSR (screen-space reflections) while
preserving native behavior
- Fixes bevyengine#21700
## Solution
- Kept native SSR unchanged by defining `USE_DEPTH_SAMPLERS` shader def
on native
- the pipeline still binds filtered depth samplers and uses
`textureSampleLevel` on depth
- added manual depth sampling in `ssr/raymarch.wgsl` via `textureLoad`
with clamped bilinear and nearest helpers
- This avoids the validation error previously happening on web
(documented in the linked issue above)
## Testing
- Ran the ssr example on native and web using the bevy CLI
- Ran the atmosphere example on native and web
---
## Showcase
Atmosphere example running (fixed) using deferred rendering + SSR on web
browser (chrome)
<img width="1388" height="1140" alt="Screenshot 2025-12-18 at 3 26
21 PM"
src="https://github.com/user-attachments/assets/bc9484c1-e3f2-4adf-a740-c0a7c3312a8d"
/>1 parent a8f19a2 commit edde626
2 files changed
+54
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
552 | 552 | | |
553 | 553 | | |
554 | 554 | | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
555 | 558 | | |
556 | 559 | | |
557 | 560 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
32 | 81 | | |
33 | 82 | | |
34 | 83 | | |
| |||
241 | 290 | | |
242 | 291 | | |
243 | 292 | | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
| 293 | + | |
| 294 | + | |
248 | 295 | | |
249 | 296 | | |
250 | 297 | | |
| |||
0 commit comments