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

Abierto
#2,007 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@bkaradzic-microsoft ya está trabajando en esto.

Desde el 3/11/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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.

Lenguaje dominante
C++
Estrellas
931
Forks
169
Merge medio
2 d 17 h
PR fusionados (30 d)
66

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de BabylonJS/BabylonNative

Todos los issues de BabylonJS/BabylonNative

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.