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

@luma.gl/gltools

Package Overview
Dependencies
Maintainers
8
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@luma.gl/gltools

WebGL2 API Polyfills for WebGL1 WebGLRenderingContext

  • 8.0.0-beta.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
128K
decreased by-7.97%
Maintainers
8
Weekly downloads
 
Created

What is @luma.gl/gltools?

@luma.gl/gltools is a package that provides a set of tools and utilities for working with WebGL. It is part of the luma.gl suite, which is designed to simplify the process of creating high-performance WebGL applications. The package includes utilities for managing WebGL contexts, handling shaders, and working with textures and buffers.

What are @luma.gl/gltools's main functionalities?

WebGL Context Management

This feature allows you to create and manage WebGL contexts easily. The `createGLContext` function initializes a WebGL context, which is essential for rendering graphics using WebGL.

const {createGLContext} = require('@luma.gl/gltools');
const gl = createGLContext();

Shader Compilation

This feature provides utilities for compiling shaders. The `compileShader` function takes a WebGL context, shader type, and shader source code, and returns a compiled shader object.

const {compileShader} = require('@luma.gl/gltools');
const vertexShaderSource = '...';
const fragmentShaderSource = '...';
const vertexShader = compileShader(gl, gl.VERTEX_SHADER, vertexShaderSource);
const fragmentShader = compileShader(gl, gl.FRAGMENT_SHADER, fragmentShaderSource);

Texture Management

This feature simplifies the process of creating and managing textures. The `createTexture` function creates a WebGL texture object from an image or other data source.

const {createTexture} = require('@luma.gl/gltools');
const texture = createTexture(gl, {data: image, width: 256, height: 256});

Buffer Management

This feature provides utilities for creating and managing WebGL buffers. The `createBuffer` function initializes a WebGL buffer with the provided data.

const {createBuffer} = require('@luma.gl/gltools');
const buffer = createBuffer(gl, new Float32Array([0, 0, 1, 1, 2, 2]));

Other packages similar to @luma.gl/gltools

Keywords

FAQs

Package last updated on 07 Dec 2019

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