Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-gles

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-gles

**This repo is under active development and is not production-ready. We are actively developing as an open source project.**

  • 0.0.17
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
decreased by-42.31%
Maintainers
1
Weekly downloads
 
Created
Source

Headless WebGL / OpenGL ES runtime for Node.js

This repo is under active development and is not production-ready. We are actively developing as an open source project.

Details

This project aims to provide a headless runtime for WebGL and OpenGL ES shaders under Node.js. This package will use the ANGLE engine to translate WebGL and OpenGL ES shaders to the target runtime. Please see the ANGLE project for more details on support.

Future plans include surfacing an API for running Compute Shaders and a OpenGL ES API. Patches are welcome!

Supported platforms

  • Mac OS
  • Windows
  • Linux

Creating a WebGL context

To create a new WebGLRenderingContext or WebGL2RenderingContext - simply include the package and call createWebGLRenderingContext():

const nodeGles = require('node-gles');

const gl = nodeGles.binding.createWebGLRenderingContext();

// Now, use `gl` for regular WebGL calls:
const tex = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, texture);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
...

Run demo

Clone this repo for current demos - examples coming soon

  • Float32 texture upload and download:
$ yarn ts-node src/tests/float_texture_upload_test.ts
...

buffer:  Float32Array [ 0.5, 1.5, 2.5, 3.5 ]
  • Float16 texture upload and download:
$ yarn ts-node src/tests/half_float_texture_upload_test.ts
...

buffer:  Float32Array [ 0.5, 1.5, 2.5, 3.5 ]
  • Unsigned byte texture upload and download:
$ yarn ts-node src/tests/unsigned_byte_texture_upload_test.ts
...

buffer:  Uint8Array [ 1, 2, 3, 4 ]

Development

Build instructions are under heavy development and will include an Angle binary

This project currently requires ANGLE to be checked out and built in the same parent folder as this repo. Checkout and build ANGLE with the Debug setup. After ANGLE is built, run yarn for this project.

FAQs

Package last updated on 16 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc