Validation workaround `prime-effect-layers`: extra frame needed before capture when effect layers exist

Open
#2,006 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@bkaradzic-microsoft is already working on this.

Since Nov 3, 2026.

Assessment

This issue has not been assessed yet.

Description

Affected tests (10)

  • Glow layer and LODs
  • Attractors
  • Glow layer and LODs
  • Prepass SSAO + highlight layer
  • sphere-with-custom-shader-to-display-wireframe-using-glow-layer
  • dissolve-effect-with-node-material-and-glow-layer
  • Glow layer with vertex alpha
  • Particles - Attractors
  • Selection outline layer with instances
  • Selection outline layer with instances and LOD

What the workaround does

Renders one extra frame before capture when the scene has effect layers (GlowLayer / HighlightLayer). Without it, the first captured frame is missing the glow/highlight contribution on BN. Introduced in #1913.

Recommended fix

Root cause is not confirmed. Capture the first frame with RenderDoc and compare with the second:

  • If the effect-layer RTT is rendered after the main pass in the same frame (view ordering / submission order in NativeEngine / bgfx view IDs), fix view ordering in BN so RTTs are submitted before the views that sample them.
  • If the effect layer's isReady() returns true before its effects/merge effect are compiled, fix readiness in Babylon.js (EffectLayer.isReady / _shouldRender).
    Then 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.