Skip to content

Low-roughness reflections alias near the poles of an equirect environment #457

Open

Description

@bdero

Related to #185.

The radiance cube's mirror band reads the source equirect with a single base-level tap per cube texel (SampleSourceRadianceLod(n, 0.0) in shaders/flutter_scene_prefilter_radiance_cube.frag). Toward the poles, one cube texel covers many equirect columns, so the tap picks one of them instead of averaging them. The same fan at the poles that #185 fixed in the skybox gets baked into the cube, and mirror-like materials reflect it.

The skybox fix doesn't reach this path because it only changed where the visible sky reads the equirect (SampleEquirectByFootprint in shaders/texture.glsl). The prefilter can use the same idea. It can compute each cube texel's footprint from the projection and pass it as an explicit gradient, or it can supersample the texel. The low-roughness bands get their mip level from an average texel solid angle, which ignores the 1/cos(latitude) stretch, so they probably undersample near the poles too.

The band atlas layout (native GLES, Adreno Android) reads the source the same way in shaders/flutter_scene_prefilter_env.frag, and the atlas is itself an equirect, so the fan at its poles also appears when reflections read it.

To reproduce, load a high-resolution HDR with detail near the zenith and look at a reflection of the sky overhead on a smooth metallic sphere (roughness near 0).

Activity

  1. added
    renderingBehavior when preparing or drawing geometry to the screen.
    bugSomething isn't working.
    on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working.renderingBehavior when preparing or drawing geometry to the screen.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions