0.9.3 • Published 6 years ago

node-webgl-raub v0.9.3

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

WebGL for Node.js

WebGL crossplatform addon with minimized dependencies.

  • IMPORTANT: as of 0.9.0 the ownership of Document is given to node-glfw.

Install

npm i -s node-webgl-raub

Note: as this is a compiled addon, compilation tools must be in place on your system. Such as MSVS13 for Windows, where ADMIN PRIVELEGED npm i -g windows-build-tools most probably helps.

Usage

This is an implementation of WebGL for Node.js.

const webgl = require('node-webgl-raub');

Here webgl is what contains all the WebGL api - WebGLRenderingContext. However a window is required to exercise your GL skills on. There is a nice implementation for that, though different ones are quite possible.

As soon as you create and set up a window, simply follow the WebGLRenderingContext docs.

NOTE: If you are planning to use browser WebGL libs, be aware of their browser-affinity. You would have to provide several additional interfaces to mimic the browser. There is node-glfw module, which exports the Document class. It can be used the following way:

const webgl = require('node-webgl-raub');
const { Document } = require('node-webgl-raub');

Document.setWebgl(webgl); // plug this WebGL impl into the Document

const doc = new Document();
global.document = global.window = doc;

const canvas = document.createElement('canvas'); // === doc
const gl = canvas.getContext('webgl'); // === webgl

Three.js

Being a low level interface, WebGL requires a lot of effort to build apps. For that matter there are numerous frameworks around it. One of them is three.js. It is known to work well on Node.js with this implementation of WebGL.

You can try to use three.js your own way, but there is a far better option: node-3d-ready, which gets you two more steps ahead for free.

0.9.3

6 years ago

0.9.2

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago

0.8.4

6 years ago

0.8.3

6 years ago

0.8.2

6 years ago

0.8.1

6 years ago

0.8.0

6 years ago

0.7.4

7 years ago

0.7.3

7 years ago

0.7.2

7 years ago

0.7.1

7 years ago

0.7.0

7 years ago

0.6.9

7 years ago

0.6.8

7 years ago

0.6.7

7 years ago

0.6.6

7 years ago

0.6.5

7 years ago

0.6.4

7 years ago

0.6.3

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.9

7 years ago

0.5.8

7 years ago

0.5.7

7 years ago

0.5.6

7 years ago

0.5.5

7 years ago