Fall back to the radiance atlas on Android native - #242
Conversation
|
Thank you for your efforts investigating this & for proposing this patch (as well as your upstream patch), and apologies I have not addressed it directly yet. I recently had the chance to investigate the whole mipmap situation going on upstream, and I think the correct way forward is to land this as a temporary holdover and get it published before the Flutter 3.47 stable release so that no users will encounter the IBL behaving this badly in Scene. But enabling the old banded path for all Android devices has such huge reach that I need to do a little bit more testing against my array of phones to make sure the banded route is still well vetted. I have an old Adreno 6xx device (a Pixel 3 XL), but it actually has a driver which is broken in a much worse way: It hangs on flutter_gpu blits entirely, and so I can't test this. By the way, would love to know what you're working on with Scene. If you haven't had the chance and are able, feel free to join the Discord and share what you're working on. I would love to hear about it. : ) |
Android Impeller Vulkan produces over-sharp cubemap-mip IBL reflections on multiple devices even though the generic mip capabilities are available. Keep the verified atlas path on native Android while retaining cubemap-mip on web and other native platforms. Add platform-selection coverage for Android, web, macOS, and unsupported backends.
e625f12 to
19f22a0
Compare
Fixes #241
Problem
Android Impeller Vulkan produces overly sharp cubemap-mip IBL reflections on multiple physical devices even when the generic mip capability checks succeed. The Redmi startup log identifies the active backend as Impeller Vulkan:
The issue reproduces on a Redmi K60 Pro and a OnePlus 13. The cubemap-mip and radiance-atlas layouts both render normally on Windows and web, so this change does not alter their layout selection.
Visual comparison
Change
This PR keeps Android native environments on the existing verified radiance atlas path, while retaining cubemap-mip radiance on web and other native platforms. It extracts the layout-selection decision into a testable helper and adds focused coverage for Android, web, macOS, and backends without manual mip support.
Validation
Validated with:
packages/flutter_scene/test/environment_radiance_layout_test.dartScope and limitation
This PR is an application-level workaround: Android native keeps using the verified radiance atlas path instead of the cubemap-mip layout.
It does not identify or address the underlying Impeller Vulkan rendering behavior. I will continue isolating the issue with a minimal reproduction; once the responsible layer is confirmed, the follow-up report or patch will be sent to the appropriate Flutter upstream project.
Related rendering artifact
The Android radiance-atlas result still shows visible regular striping artifacts across the car body, especially on the hood and roof. The visual comparison above demonstrates the IBL reflection workaround only; it does not fix this artifact. The striping is visually similar to the mobile-only issue reported in #234, but the relationship is still unconfirmed: #234 concerns directional-light shadows at distance and is sensitive to shadow bias/precision, while this PR changes only IBL radiance-layout selection. This PR does not change the shadow path.