Verge3D Developer Kit

Verge3D Developer Kit (DevKit) is a collection of examples, tools and source code which comes with Verge3D Enterprise package. This collection will help you to perform various developer tasks such as:

Developer Kit is intended for seasoned programmers who wish to explore or modify the engine. You don't need it for creating Verge3D applications with the standard set of functionality.

Installation and Configuration

Grab the DevKit archive from the download area of your account dashboard. Unpack this archive to a directory of your choice.

If you're going to build Verge3D engine or Puzzles from source code, you'll need the npm utility which is part of the Node.js runtime. You can install it by following these instructions.

Finally, go to the unpacked directory of DevKit and execute the following command to install the dependencies:

npm install

DevKit Structure

Freshly installed DevKit includes the following directories:

Directory Description
addons/verge3d Source code of Blender add-on (Verge3D for Blender or Verge3D Ultimate).
build Pre-built Verge3D engine scripts and additional modules (ammo.js, etc).
ktx Binaries for texture compression module.
max_plugin Source code of 3ds Max plugin (Verge3D for 3ds Max or Verge3D Ultimate).
maya_plugin Source code of Maya plugin (Verge3D for Maya or Verge3D Ultimate).
puzzles Pre-built scripts and source code of the Puzzles editor.
python Python 3 runtime and utility modules.
src Verge3D engine source code.
templates Verge3D application templates.
utils Various utility scripts.
wordpress Verge3D for WordPress plugin source code.
xz Source code of the XZ compression module.

Building Verge3D

Before compiling Verge3D, please make sure you installed npm and all required dependencies as described above.

To compile an unoptimized build of Verge3D, which suits well for testing and debugging purposes, execute the following command in the DevKit directory:

npm run build

You can find the compiled modules inside the build directory of your DevKit. To test it, simply copy v3d.js engine module to your application inside Verge3D installation, for example:

cp build/v3d.js APPS_FOLDER/my_awesome_application/

To compile an optimized of Verge3D (aka release version), execute the following command in the DevKit directory:

npm run build-release

The following commands are used to build the Puzzles logic editor. To build an unoptimized version type:

npm run build-puzzles

To build an optimized version, execute:

npm run build-puzzles-release

You can find the compiled Puzzles editor script inside the puzzles directory of your DevKit. To apply it to Verge3D, copy the entire content of this directory to the puzzles directory inside your Verge3D installation (replacing files which already exist there).

Activating Engine Module

To sign the compiled engine module with your license key, use the keymanager.py script from the utils directory (python required):

./keymanager activate ../build/v3d.js XXXXXXXXXX

Where XXXXXXXXXX is your license key. Since this command does not print anything, you need to verify if the activation was a success by copying the module to some app folder and checking for the MADE WITH VERGE3D TRIAL watermark.

Adding New Method to JavaScript API

Say, you want to add another method to the App class. For example, a printHelloWorld() method should print something to the browser console:

App.printHelloWorld()

The App class is implemented in the module located at src/extras/App.js. Open it and add the following code to the end of the file, just before the closing brackets of the App class. Don't forget to add another comma where the previous method ends.

printHelloWorld: function() { console.log('Hello World!'); }

Build and copy the Puzzles runtime to your Verge3D installation folder. You can now try the newly added block in the Puzzles editor.

Adding New Class to JavaScript API

To supplement the Verge3D API with some custom class, create a .js file named after your class in a relevant subdirectory of DevKit's src folder (e.g. src/extras/MyAwesomeClass.js). In this .js file, implement your class - you can get inspired by already existing classes. Finally, register your class in the global namespace v3d by adding the following line in src/v3d.js file:

export { MyAwesomeClass } from './extras/MyAwesomeClass.js';

Build and copy the Verge3D runtime to your application, and try it out in the browser console.

const myAwesomeStuff = new v3d.MyAwesomeClass(); myAwesomeStuff.whatEver();

Adding New Puzzles

To create a custom Puzzles block, edit the puzzles/src/puzzles_blocks.js file. You can get inspired by already existing puzzles. Register it in a relevant toolbox category in the top of the file.

Build and copy the Puzzles runtime to your Verge3D installation folder. You should now find your new puzzle in the toolbox of the Puzzles editor.

Instead of editing puzzles_blocks.js, you can put your custom code in a plugin which makes it more reusable.

Supporting New Platforms and Architectures

Verge3D is a cross-platform software, which can be used to develop 3D web applications on any platform capable of running Blender, 3ds Max, or Maya. However, the glTF exporters require the texture compression utility called toktx (part of the KTX texture compression tools) to work properly.

Verge3D distributions include this tool for the most commonly used platforms: Windows (Intel 64-bit), macOS (Intel 64-bit and Apple Silicon), Linux (Intel 64-bit), and ChromeOS (Intel 64-bit). For others, say Windows ARM, BSD systems, Loongson/LoongArch, Raspberry PI, RISC-V devices, etc, you might need to build the KTX software manually by using the instructions provided here.

Once you have the toktx utility built and tested, place it in the ktx/ARCHITECTURE folder inside the Verge3D's installation folder replacing ARCHITECTURE by the new platform name. To obtain this name, execute the basic Python script located inside the ktx directory of DevKit:

./show_arch.py

for UNIX-like systems, or

python show_arch.py

for Windows systems.

Got Questions?

Feel free to ask on the forums!