Validation workaround `opaque-clear-alpha`: framebuffer alpha differs from WebGL with opaque clear

Offen
#2,007 0 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@bkaradzic-microsoft arbeitet bereits daran.

Seit 03.11.2026.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

Affected tests (15)

  • Ribbon morphing
  • Solid particle system
  • RH billboard
  • Particle Helper
  • Area Lights - Standard Material
  • Textured - Area Lights - Standard Material
  • Textured - Area Lights - PBR
  • Area Lights - PBR
  • Enable disable post process
  • Prepass SSAO + depth of field
  • Prepass SSAO + on/off post-process
  • Particles - Multiply Blend
  • Particles - Helper - Sun
  • Particles - Helper - Smoke
  • Particles - Helper - Fire

What the workaround does

When the scene clears with an opaque color but the read-back image contains alpha < 1, the harness skips compositing over the canvas background (browser composites the canvas with the page). Without it, BN screenshots differ where blended geometry writes alpha < 1. Introduced in #1913.

Recommended fix

Likely the alpha channel of blended draws differs from WebGL (separate alpha blend factors / alphaMode mapping). Compare per-pixel alpha of the BN readback with WebGL readPixels for one affected test; fix the alpha blend state mapping in NativeEngine (setAlphaMode → bgfx BGFX_STATE_BLEND_FUNC_SEPARATE) so alpha matches WebGL. Then the harness can composite identically to the browser and the workaround can be removed.


Workaround implementations live in Apps/Playground/Scripts/validation_native.js (WORKAROUNDS map); tests opt in via the workarounds array in Apps/Playground/Scripts/config.json. See Documentation/AddingNewValidationTests.md.

Vorherrschende Sprache
C++
Sterne
931
Forks
169
Ø Merge
2 T. 17 Std.
Gemergte PRs (30 T.)
66

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus BabylonJS/BabylonNative

Alle Issues in BabylonJS/BabylonNative

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.