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

Aperta
#2,007 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@bkaradzic-microsoft ci sta già lavorando.

Dal 3/11/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.

Lingua principale
C++
Stelle
931
Fork
169
Merge medio
2g 17h
PR unite (30g)
66

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di BabylonJS/BabylonNative

Tutte le issue di BabylonJS/BabylonNative

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.