Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including nogl with all npm packages installed. Try it out:

var nogl = require("nogl")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

nogl v1.1.0

WebGL shim for node

WebGL context minimal shim for node. Useful to make stackgl components not fail in node.

npm install nogl

var Shader = require('gl-shader');
var gl = require('nogl')();
var glslify = require('glslify-sync');
var createProcessor = require('nogl-shader-output');

var shader = Shader(gl, glslify('./vertex.glsl'), glslify('./fragment.glsl'));

var draw = createProcessor(shader);

    size: [10, 20]

API is compatible with webgl-context. If you need real webgl, use headless-js. For practical use-case look nogl-shader-output. Heavily inspired by emscripten headlessCanvas.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free