Skip to content

Latest commit

 

History

History
107 lines (78 loc) · 4.75 KB

CONTRIBUTING.md

File metadata and controls

107 lines (78 loc) · 4.75 KB

Contribute to GLAS

Thank you for your interest in developing GLAS.🤘

Overview

This project uses TypeScript, JavaScript, and AssemblyScript, and compiles most of the code into WebAssembly. We currently recommend using Visual Studio Code development environment, Node.js, and npm for package management (ships with Node.js), etc -- see below. For Mac users recommended tools include: iTerm terminal, brew, and zsh shell.

Recomended Reading

Important Links

Prerequistes

Soft Skills

  • Basic knowledge of 3D Objects and Rendering.
  • Fundamentals of AGILE processes, open source protocols, git.
  • Ability to make pull requests on GitHub to share code changes.
  • Proficency with the NodeJS ecosystem and ECMAScript.
  • Asking questions, no question is dumb. This stuff is uncharted.
  • Is human and breathing; sorry no zombies. =[

Software Requirements

Getting Started

Checkout Code

First we need to clone (https://github.com/lume/glas) into a cozy spot in your ~/code or wherever you work from. You can also clone from your own fork of the repository.

   cd ~/code
   bash git clone https://github.com/lume/glas

Project Structure

We try to keep the project root simple and free of clutter. Below is brief overview of the organization of the project files and directories.

project
  ├── dist/ # contains build output after running `npm run build`. This structure mirrors that of the src/ folder.
  ├── examples/ # Examples that use the glas library.
  ├─┬ src/
  | ├─┬ as/ # contains AssemblyScript code which is compiled into a WebAssembly module. This code runs inside the WebAssembly environment. The code in here mirrors the structure the src/ folder in the Three.js repository.
  | | ├── index.ts # entry point for the WebAssembly module.
  | | └── tsconfig.json # AssemblyScript compiler settings for WebAssembly─side code
  | └─┬ ts/ # contains TypeScript code which runs on the JavaScript side. This code loads and runs the WebAssembly module in an HTML page.
  |   ├── index.ts # entry point for JavaScript─side code
  |   └── tsconfig.json # TypeScript compiler settings for JavaScript─side code
  └── *.* # any files at the root of the project are meta files like package.json, editorconfig, etc.

Dependencies

Currently the only runtime depenedency that we rely on is ASWebGLue which handles the underlying WebGL bindings. This library provides a WebGL.ts module that GLAS imports. ASWebGLue also has JS glue code that gets passed into our GLAS modules via import objects. Basically we make a WebGL calls from our program which makes a native JavaScript calls to the JS-side WebGL functions. Pretty neat right! It is important to note that GLAS and ASWebGLue are both compiled directly into your AS program. ASWebGLue is not a standalone runtime dependency; it is not a standalone Wasm module that is separately loaded.

Example of dev process

As an example, the Three.js files src/math/Matrix4.js, src/math/Matrix4.d.ts, and test/unit/math/Matrix4.tests.js got ported to the glas equivalent of src/as/math/Matrix4.ts and src/as/math/Matrix4.spec.ts.

For comparison, see the original files from Three.js,

and the ported files within glas:

Once a set of Three.js files (.js, .d.ts, and .tests.js) are ported, we can run the unit tests (or run them as we go during porting).

You can read more about this on the Development page