Skip to content

Add NativeEncoding plugin#1555

Merged
alexchuber merged 26 commits into
BabylonJS:masterfrom
alexchuber:add-native-encoding
Oct 27, 2025
Merged

Add NativeEncoding plugin#1555
alexchuber merged 26 commits into
BabylonJS:masterfrom
alexchuber:add-native-encoding

Conversation

@alexchuber

@alexchuber alexchuber commented Oct 15, 2025

Copy link
Copy Markdown
Member

This PR introduces the NativeEncoding plugin, which provides native image encoding capabilities to JavaScript. Raw pixel data can be encoded into standard image formats (PNG, JPEG, WebP, etc.), serving Babylon.js's needs for texture export.
See the README for more info.

As this PR is focused on the plugin (and some smoke tests for it), the following will be delegated to future PRs:

  • Adding example use cases to the Playground
  • Adding example use cases to the visual test suite
  • Using the plugin from TestUtils

Comment thread Plugins/NativeEncoding/Source/NativeEncoding.cpp Outdated
Comment thread Plugins/NativeEncoding/Include/Babylon/Plugins/NativeEncoding.h
Comment thread Plugins/NativeEncoding/Source/NativeEncoding.cpp Outdated
@alexchuber alexchuber marked this pull request as ready for review October 16, 2025 02:11
@alexchuber alexchuber marked this pull request as draft October 16, 2025 03:17
@CedricGuillemet

Copy link
Copy Markdown
Collaborator

TestUtils plugin has a basic png writer (

void TestUtils::WritePNG(const Napi::CallbackInfo& info)

) that should be replaced by this PR change. It's being used by https://github.com/BabylonJS/BabylonNative/blob/master/Apps/Playground/Scripts/validation_native.js

@alexchuber

Copy link
Copy Markdown
Member Author

TestUtils plugin has a basic png writer that should be replaced by this PR change.

Totally. Will do this in a follow-up PR.

Comment thread Plugins/NativeEncoding/Source/NativeEncoding.cpp
Comment thread Plugins/NativeEncoding/Source/NativeEncoding.cpp Outdated
Comment thread Plugins/NativeEncoding/README.md Outdated
Comment thread CMakeLists.txt Outdated
@alexchuber alexchuber merged commit deec210 into BabylonJS:master Oct 27, 2025
20 checks passed
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.

4 participants