Skip to content

Add native cube render target support (re-enables 2 shadow-with-instances tests)#1750

Draft
bkaradzic-microsoft wants to merge 1 commit into
BabylonJS:masterfrom
bkaradzic-microsoft:native-cube-render-target
Draft

Add native cube render target support (re-enables 2 shadow-with-instances tests)#1750
bkaradzic-microsoft wants to merge 1 commit into
BabylonJS:masterfrom
bkaradzic-microsoft:native-cube-render-target

Conversation

@bkaradzic-microsoft

@bkaradzic-microsoft bkaradzic-microsoft commented Jun 11, 2026

Copy link
Copy Markdown
Member

Paired engine PR: BabylonJS/Babylon.js#18561

What

Implements cube render targets on the native engine so ReflectionProbe and
point-light cube shadow maps render instead of crashing on the null WebGL
context. Pairs with the Babylon.js change that adds the JS-side overrides.

Changes

  • Plugins/NativeEngine/Source/NativeEngine.cpp
    • InitializeTexture: optional isCube param → Texture::CreateCube.
    • CreateFrameBuffer: optional layer param so the color attachment targets
      a single cube face (bgfx::Attachment layer). The JS side creates one
      framebuffer per face and binds the matching one per face.
  • Apps/Playground/Scripts/config.json: re-enables "Shadows with instances in
    left/right handed system" (previously excluded as crash/hang).

CI

The validation suite uses the published babylonjs npm, which does not yet
contain the paired JS overrides, so the re-enabled tests stay red until a
babylonjs release with the Babylon.js change ships and the dependency is
bumped here. Draft until then.

Verified locally

Built against a local babylon.max.js with the paired change: the two
re-enabled tests pass and there are no regressions in post-process / 2D
render-target tests.

…nces tests)

Render-to-cubemap on the native engine so ReflectionProbe and point-light
cube shadow maps render instead of dereferencing the null WebGL context.

- InitializeTexture: optional isCube param -> Texture::CreateCube.
- CreateFrameBuffer: optional layer param so the color attachment targets a
  single cube face (bgfx::Attachment layer); the JS side creates one
  framebuffer per face and binds the matching one per face.

Re-enables the "Shadows with instances in left/right handed system" validation
tests that previously crashed/hung.

Requires the paired Babylon.js change (native cube render target JS overrides);
CI stays red until a babylonjs npm with that change is published and the dep
bumped here.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants