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

@luma.gl/webgl

Package Overview
Dependencies
Maintainers
6
Versions
234
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@luma.gl/webgl

WebGL2 adapter for the luma.gl core API

  • 9.1.0-alpha.18
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
99K
decreased by-58.53%
Maintainers
6
Weekly downloads
 
Created

What is @luma.gl/webgl?

@luma.gl/webgl is a WebGL framework that provides a set of tools and utilities for working with WebGL. It is designed to simplify the process of creating high-performance 3D graphics applications in the browser. The package offers a range of features including context creation, shader management, buffer handling, and more.

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

Context Creation

This feature allows you to create a WebGL context, which is the starting point for any WebGL application. The code sample demonstrates how to create a WebGL context using a canvas element.

const {createGLContext} = require('@luma.gl/webgl');
const canvas = document.createElement('canvas');
const gl = createGLContext({canvas});

Shader Management

This feature provides utilities for managing shaders, which are essential for rendering graphics in WebGL. The code sample shows how to create vertex and fragment shaders using the @luma.gl/webgl package.

const {Shader} = require('@luma.gl/webgl');
const vertexShaderSource = `
  attribute vec4 position;
  void main() {
    gl_Position = position;
  }
`;
const fragmentShaderSource = `
  void main() {
    gl_FragColor = vec4(1, 0, 0, 1);
  }
`;
const vertexShader = new Shader(gl, {source: vertexShaderSource, shaderType: gl.VERTEX_SHADER});
const fragmentShader = new Shader(gl, {source: fragmentShaderSource, shaderType: gl.FRAGMENT_SHADER});

Buffer Handling

This feature allows you to create and manage buffers, which are used to store vertex data. The code sample demonstrates how to create a buffer and upload vertex positions to it.

const {Buffer} = require('@luma.gl/webgl');
const positions = new Float32Array([
  -1, -1,
   1, -1,
  -1,  1,
   1,  1
]);
const positionBuffer = new Buffer(gl, {data: positions});

Other packages similar to @luma.gl/webgl

Keywords

FAQs

Package last updated on 29 Aug 2024

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