Code Monkey home page Code Monkey logo

node-webgl's Introduction

This is a port of WebGL for desktops: windows, linux, mac

It started as an extension of creationix/node-webgl and their great example com.creationix.minimason that you can find in examples/wavefront.js. However, it is now quite different and support different platform bindings, mainly GLFW instead of SDL.

Dependencies

  • node-glfw which depends on GLEW, GLFW as well as AntTweakBar. See node-glfw for installation instructions.

  • freeimage freeimage is used to load/save a variety of image formats.

Installation

node-waf configure build

Usage

examples/ contains examples from other the web test/ contains lessons from www.learningwebgl.com and other tests

simply type: node test/lesson02.js

Enjoy!

Limitations

WebGL is based on OpenGL ES, a restriction of OpenGL found on desktops, for embedded systems. Because this module wraps OpenGL, it is possible to do things that may not work on web browsers. Please read http://www.khronos.org/webgl/wiki_1_15/index.php/WebGL_and_OpenGL_Differences to learn about the differences.

  • shaders Remember to add this on top of your fragment shaders:
#ifdef GL_ES
precision highp float;
#endif
  • loading external scripts If your code uses external libraries, you can load them like this. No code change to external scripts ;-)
fs=require('fs');
eval(fs.readFileSync(__dirname+ '/glMatrix-0.9.5.min.js','utf8'));
  • frame rate requestAnimationFrame(callback [, delay]) works as in the browser. If delay is specified, it is the requested delay in milliseconds between animation frames e.g. 16 will provide 1000 / 16 = 62 fps at best, which is the default value if delay is undefined. If delay = 0, then the fastest possible framerate on your machine is used.

node-webgl's People

Contributors

mikeseven avatar creationix avatar tmpvar avatar

Stargazers

roadlabs avatar

Watchers

roadlabs avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.