SSR is noisy on mirror-like surfaces in 0.19
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## Bevy version and features
- Bevy 0.19
- Features: `["debug", "jpeg", "tiff", "bevy_dev_tools", "exr", "mp3", "tonemapping_luts", "webgpu", "track_location", "trace"]`
## \[Optional\] Relevant system information
Running on macOS 26.5, on a Macbook Pro M1 Pro 16 GB.
`AdapterInfo { name: "Apple M1 Pro", vendor: 0, device: 0, device_type: IntegratedGpu, device_pci_bus_id: "", driver: "", driver_info: "", backend: Metal, subgroup_min_size: 4, subgroup_max_size: 64, transient_saves_memory: true }`
## What you did
SSR behaves differently in 0.18.1 vs 0.19. The road material has 0.04 roughness and 0.36 reflectance; in 0.18.1 the objects on the road reflect in a mirror-like way while in 0.19 it looks pretty noisy. The image is darker overall in 0.19 as well; I bumped the emissive values on the stripes and rings to try and match them up a bit. (I ended up liking the overall look in 0.19 more, but it was completely unintentional...)
This is my camera setup for this scene:
```rust
let mut camera = builder.spawn((
GameplayCamera::default(),
RenderLayers::layer(0),
Camera { ..default() },
Camera3d { ..default() },
Projection::Perspective(PerspectiveProjection {
fov, // 40f32.to_radians()
near: 0.01,
far: DRAW_DISTANCE, // 5000
..default()
}),
Transform::IDENTITY,
AtmosphereSettings {
aerial_view_lut_max_distance: aerial_view_max_distance, // 5000
sky_view_lut_samples: atmosphere_sky_view_lut_samples(), // 12
aerial_view_lut_samples: atmosphere_aerial_view_lut_samples(), // 8
..default()
},
DistanceFog {
color: Color::srgba(0.09, 0.1, 0.16, 0.18),
falloff: FogFalloff::Linear {
start: 3_200.0,
end: 5_000.0,
},
..default()
},
Exposure {
ev100: environment.exposure_ev100, // 9.8
},
Bloom {
intensity: if settings.bloom_enabled { 0.24 } else { 0.0 },
..default() // low_frequency_boost: 0.4,
// low_frequency_boost_curvature: 0.55,
// high_pass_frequency: 0.95,
// prefilter: BloomPrefilter { ..default() },
// composite_mode: BloomCompositeMode::Additive,
// scale: Vec2::new(1.55, 2.55),
// max_mip_dimension: BLOOM_MAX_MIP_DIMENSION,
},
Msaa::Off,
TemporalAntiAliasing::default(),
Tonemapping::AgX,
ColorGrading::with_identical_sections(
ColorGradingGlobal {
temperature: 0.05,
tint: -0.01,
post_saturation: 1.05,
..default()
},
ColorGradingSection::default(),
)
));
camera.insert(ResolutionScaledSceneCamera);
if settings.screen_space_reflections_enabled {
info!("Enabling screen space reflections for gameplay camera");
camera.insert((
DepthPrepass,
DeferredPrepass,
ScreenSpaceReflections {
min_perceptual_roughness: 0.0..0.0,
..default()
},
OcclusionCulling,
));
}
if !cfg!(target_arch = "wasm32") {
camera.insert(MotionBlur {
shutter_angle: settings.motion_blur.menu_shutter_angle(), // 1.5
samples: motion_blur_samples(settings.motion_blur.menu_samples()), // 3
});
}
```
## What went wrong
Scene in 0.18.1:
Scene in 0.19:
(I seem to also have run into an UI bug but that's not the focus here)
Contributor guide
Research direction
Reproduce the supplied scene on Bevy 0.18.1 and 0.19 using the camera setup and ScreenSpaceReflections configuration from the report. Compare the SSR rendering path and determine why mirror-like surfaces become noisy and darker; done means the regression is explained and the intended behavior is restored or documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100