Three.V8

3D rendering engine using JavaScript as user script.

View on GitHub

Three.V8

Three.V8 was created as a proof of concept (POC) of an embedabble 3D rendering engine using JavaScript as user script.

The ongoing development targets mobile devices, tries to provide another JavaScript based application framework with 3D rendering as its core-function.

The source code here builds & runs on Windows, which can be used for evaluation or script development/debugging.

The Windows implementation requires Visual Studio 2022 to be built, becuase:

Subprojects

3rd-party libraries

Building

Building is straightforward using Visual Studio 2022. Just make sure to resolve the git submodules first.

Runing GamePlayer

Run the executable “GamePlayer\bin\Release\GamePlayer.exe”:

screenshot.png tolerance The script “../../../game/bundle.js” is loaded by default. You can load your own script by clicking the button “Load Script”.

The engine doesn’t support ES6 modules eg. “import”. User scripts need to be pre-bundled using bundlers like rollup.js

Security Model

Three.V8 is NOT a web-browser, therefore it does not always follow the web-security protocols.

Instead, Three.V8 works like other script-based game-engines, i.e., the script is a part of the application package.

Part of the scripting APIs does have direct access to native file-systems and devices. There is not a web-browser style sandbox.

“eval()” should be banned in production code. The engine ensures that only the scripts pass from the host application can be executed. As a result, we consider the host application to have full responsibility that the executed scripts come from reliable sources.

Note that the network scripting APIs are capable of obtaining all kinds of data from the internet, including scripts. We just make sure that the scripts obtained this way doesn’t have a chance to get executed.

Updating the scripts from a remote source can possibly be conducted by the host application, which would provide some extra convinience. However, this type of behavior might be forbidden by some mobile platforms, even if the sources are reliable. We therefore call for some reasonable tolerance from these platforms.

License

The source code is licensed under ‘“Anti 996” License’ by Fei Yang and Vulcan Eon (北京鲜衣怒马文化传媒有限公司).

Documentation

User Script APIs

Features and Code Snippets

All features are also available in a unreleased Android build.

Please contact me if you are interested in the Android version of Three.V8:

GMail: hyangfeih@gmail.com

Twitter: @feiyangvr

You can use the mobile engine in your own product by business cooperation with Vulcan Eon.

Or, more preferable, try hiring me.

Android.png