Visitar URL original
vpool (WebGPU): ghosted / setOpacity views flicker on every redraw of the same pose · Issue #63 · ThatOpen/platform_services · GitHub
Skip to content

vpool (WebGPU): ghosted / setOpacity views flicker on every redraw of the same pose #63

Open

Description

@helenkwok

With @thatopen-platform/fragments-beta 3.5.14 on WebGPU, a streamed model with ghosted elements (setOpacity) flickers. Drawing the same camera pose twice gives a different image.

Measured

That Open's own school_arq.frag and school_str.frag (from thatopen.github.io/engine_fragment/resources/frags/), converted with writeStreamedFiles, both ghosted with setOpacity(0.12). Three WebGPURenderer on Deno 2.9.6's own WebGPU (wgpu, Metal), 960×540. Pixels that differ between two redraws of one pose (of 518,400; a pixel counts when the RGB difference sums to over 24):

Camera distance 351 m 191 m 112 m 64 m 38 m
elements' own colours 2 415–569 309–816 11,077–37,199 279–306
every faded face one colour 0 0 0–1 5–6 1

We saw the same flicker in Chrome on our own models. WebGL vpool does not flicker.

Cause, as far as we can see

  • The culling compute pass compacts each frame's surviving triangles with atomicAdd (wgsl.mjs), so the indirect draw list comes out in a different order every frame.
  • Faded elements are drawn through one translucent mesh (vpool-fade, alpha blended, no depth write) in each element's own colour.
  • Translucent faces of different colours blend to a different result in a different order. With one colour the blend is order-independent, which matches the second row.

Possible fixes

Build the draw list in a stable order (a prefix sum instead of atomicAdd), or sort the fade list. A depth pre-pass for the ghost does stop the flicker, but vpool's occlusion culling reprojects the previous frame's depth and then culls everything inside the ghost, so that isn't a fix.

Workaround we use

Give every vpool-fade face one colour: material.colorNode = vec4(vec3(0.85), colorNode.w). The image is stable, but every ghost looks the same.

Note: vpool only draws streamed models, so a plain .frag loaded with load() won't show this. Screenshots and the harness are available if useful.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions