Skip to content

Build cross-platform native applications with the power of the Babylon.js JavaScript framework

License

Notifications You must be signed in to change notification settings

ryantrem/BabylonNative

 
 

Repository files navigation

Build Status

Babylon Native

Build cross-platform native applications with the power of the Babylon.js JavaScript framework.

See this blog entry for more details.

This project is under heavy development. Not all intended platforms are currently implemented. DO NOT use in production code.

Getting Started

Windows

Prerequisites

  • CMake 3.12 or higher
  • Python 3.x
  • Visual Studio 2017 or 2019

Build

  • Clone this repo.
  • Update the submodules.
    C:\BabylonNative>git submodule update --init --recursive
    
  • Create a new directory for the build files, e.g. Build at the root of the repo.
    C:\BabylonNative>mkdir Build
    
  • Change your working directory to the new directory.
    C:\BabylonNative>cd Build
    
  • Run CMake from the new directory and point to the root of the repo.
    C:\BabylonNative\Build>cmake ..
    
  • Open the generated solution BabylonNative.sln.
    C:\BabylonNative\Build>start BabylonNative.sln
    
  • Once the solution opens, right click the TestApp project, click "Set as StartUp Project" and click the play button at the top to run the test app which should render a box

Android / iOS / MacOS

Planned but not yet implemented

Development Notes

glslang and SPIRV-Cross

In order to compile the WebGL GLSL shader to the required bits for the target platform, this project utilizes glslang and SPIRV-Cross. See ShaderCompiler.h and its corresponding implementation for details.

arcana.cpp

This project makes substantial use of the utilities contained within the arcana.cpp project, especially the support for asynchronous task execution and thread synchronization.

N-API

This project uses a subset of node-addon-api and the JavaScript part of N-API to target either V8 or Chakra. See this thread for some context. There is also work needed to factor out the JavaScript part of node-addon-api.

The code is located here. Some small modifications were made to avoid node dependencies and improve performance. The Chakra version js_native_api_chakra.cc came from node_api_jsrt.cc and was modified to target Chakra directly. We will work on submitting these changes to the public version.

bgfx

This project uses bgfx for the cross-platform rendering abstraction. It does not use the shader abstraction of bgfx, but instead compiles the WebGL GLSL shader at runtime and generates the shader header that bgfx expects. See NativeEngine.cpp for implementation details.

base-n

This project uses base-n to implement base64 decoding for parsing data URLs.

curl

This project uses curl (or, more accurately, libcurl) as the backend for the provided implementation of XMLHttpRequest. At present, only a "golden path" is supported, but additional features will be added as they are required.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.

Reporting Security Issues

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) at [email protected]. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

About

Build cross-platform native applications with the power of the Babylon.js JavaScript framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 92.4%
  • C++ 7.1%
  • Java 0.3%
  • CMake 0.2%
  • C 0.0%
  • Swift 0.0%