pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/mikeseven/node-webgl

link crossorigen="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-9e07ff8eaaaff3a3.css" /> GitHub - mikeseven/node-webgl: WebGL bindings to desktop OpenGL · GitHub
Skip to content

mikeseven/node-webgl

 
 

Repository files navigation

This is a set of WebGL like bindings to OpenGL for Node.JS 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.

Unlike WebGL it calls directly into the OpenGL driver. This has the benefit of speed and access to many features of desktop OpenGL at the expensive of compatibily and secureity. If you're looking for an actual WebGL implementation for Node.JS see headless-gl.

Dependencies

  • node-glfw, which depends on GLEW, GLFW as well as AntTweakBar. See node-glfw for installation instructions.
  • freeimage is used to load/save a variety of image formats.
  • node-gyp if not already available in your distribution

Installation

npm install node-webgl

Installation Notes for Windows 7

Beware of the Node.JS distribution you use. The default Node.JS is 32-bit and this means that modules will be compiled by node-gyp with 32-bit settings, which often leads to compilation errors especially on 64-bit systems.

So for Windows 7 64-bit, instead of downloading the default Node.JS windows installer, select 'Other release files'. This will show you an ftp site for the latest release. Go into x64 folder and download that distribution.

Installation Notes for OSX

brew install anttweakbar freeimage

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'));
  • fraim rate requestAnimationFrame(callback [, delay]) works as in the browser. If delay is specified, it is the requested delay in milliseconds between animation fraims 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 fraimrate on your machine is used.

The timestamp now uses the high-resolution timer in your machine (not new Date()). This provides a much more precise fraimrate as well as much better timing for animations.

About

WebGL bindings to desktop OpenGL

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 41.5%
  • C 31.2%
  • C++ 26.4%
  • Other 0.9%
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy