Validation workaround `wait-for-transmission-helper`: glTF TransmissionHelper classifies meshes after scene readiness

Open Beginner friendly
#2,138 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript
Domain
desktop, testing

Research direction

Start with the workaround map in Apps/Playground/Scripts/validation_native.js, then check the opted-in tests in Apps/Playground/Scripts/config.json and the validation test guidance in Documentation/AddingNewValidationTests.md. The workaround waits for material-bearing scene meshes to appear in the glTF TransmissionHelper cache before allowing the first frame. Done means the affected validation tests no longer show the transmission flake when the workaround is enabled.

Written by the indexing model from the issue text.

Description

Affected tests (40)

  • FrameGraph convolution post process
  • GLTF Extension KHR_materials_volume
  • GLTF Extension KHR_materials_volume with analytic light
  • GLTF Extension KHR_materials_volume with attenuation
  • glTF Loader - PBRMaterial Scatter Color Density
  • glTF Loader - PBRMaterial Scatter Strength Thin-Walled
  • KHR diffuse transmission
  • OpenPBR Geometry Opacity
  • OpenPBR glTF Surface Tinting
  • OpenPBR IBL Furnace Test for Thin Film Transparency
  • OpenPBR Subsurface Color Scaling - IBL
  • OpenPBR Subsurface Dense Scattering - Analytic Lights
  • OpenPBR Subsurface Dense Scattering - IBL
  • OpenPBR Subsurface Dense Scattering - Realtime IBL
  • OpenPBR Subsurface Scatter Anisotropy - glTF
  • OpenPBR Subsurface Scatter Color Density - glTF
  • OpenPBR Subsurface Scatter Strength - glTF
  • OpenPBR Subsurface Scatter Strength Thin-Walled - glTF
  • OpenPBR Subsurface SSS Frame Graph - Analytic Lights
  • OpenPBR Subsurface SSS Frame Graph - Shadows - Combination Lights
  • OpenPBR Subsurface SSS Frame Graph - Shadows - IBL
  • OpenPBR Subsurface Transmission Blending - Analytic Lights
  • OpenPBR Subsurface Transmission Blending - IBL
  • OpenPBR Subsurface Transmission Thin-walled Blending with Textures
  • OpenPBR Subsurface Transmission Volume Blending with Textures
  • OpenPBR Thin Walled Subsurface Anisotropy - IBL
  • OpenPBR Thin Walled Subsurface Anisotropy - Realtime IBL
  • OpenPBR Thin Walled Subsurface Transmission Blending - IBL
  • OpenPBR Thin Walled Transmission IOR vs Roughness - Analytic Lights
  • OpenPBR Thin Walled Transmission IOR vs Roughness - IBL
  • OpenPBR Transmission Color glTF - Analytic Lights
  • OpenPBR Transmission Color glTF - IBL
  • OpenPBR Transmission Dense Scattering - IBL
  • OpenPBR Transmission Dense Scattering - SH
  • OpenPBR Transmission Dispersion glTF - IBL
  • OpenPBR Transmission Roughness glTF - Analytic Lights
  • OpenPBR Transmission Roughness glTF - Combination Lights
  • OpenPBR Transmission Roughness glTF - IBL
  • PBR in mirror
  • Test code inlining

What the workaround does

Skips frames before the first one until every scene mesh with a material is in the glTF TransmissionHelper's opaque or transparent cache (60 s limit). The helper classifies a new mesh two SetImmediate (1 ms timer) ticks after it is added (Scene.addMesh defers onNewMeshAddedObservable, then the helper defers the classification), and scene.isReady() doesn't wait for it. When the timers fire after the first frame, the opaque render target misses the mesh and refraction shows only the background. This is the OpenPBR transmission flake on Win32_x64_NativeWebGPU. Introduced in #2139.

Recommended fix

Fix in Babylon.js: BabylonJS/Babylon.js#19307 keeps the scene not ready until every mesh is classified. Once Babylon Native uses a Babylon.js release that includes it, remove the workaround.


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.

Dominant language
C++
Stars
931
Forks
169
Avg merge
2d 17h
Merged PRs (30d)
66

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from BabylonJS/BabylonNative

All issues in BabylonJS/BabylonNative

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.