🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@luma.gl/core

Package Overview
Dependencies
Maintainers
6
Versions
258
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@luma.gl/core

The luma.gl core Device API

9.1.9
latest
Source
npm
Version published
Weekly downloads
178K
-17.27%
Maintainers
6
Weekly downloads
 
Created

What is @luma.gl/core?

@luma.gl/core is a high-performance WebGL2 framework designed for GPU-powered data visualization and computation. It provides a suite of tools for creating and managing WebGL contexts, shaders, buffers, and other GPU resources, making it easier to build complex visualizations and simulations.

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

Creating a WebGL Context

This feature allows you to create a WebGL context, which is the starting point for any WebGL application. The context is used to manage all WebGL state and resources.

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

Shader Management

This feature allows you to create and manage shaders, which are programs that run on the GPU. Shaders are essential for rendering graphics and performing computations on the GPU.

const {Shader} = require('@luma.gl/core');
const vs = `
  attribute vec4 position;
  void main() {
    gl_Position = position;
  }
`;
const fs = `
  void main() {
    gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
  }
`;
const shader = new Shader(gl, {vs, fs});

Buffer Management

This feature allows you to create and manage buffers, which are used to store data on the GPU. Buffers are used to store vertex data, texture data, and other types of data that need to be processed by the GPU.

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

Rendering

This feature allows you to create and manage models, which are used to render graphics. Models are composed of shaders, buffers, and other resources, and they provide a high-level interface for rendering graphics.

const {Model} = require('@luma.gl/core');
const model = new Model(gl, {
  vs: `
    attribute vec4 position;
    void main() {
      gl_Position = position;
    }
  `,
  fs: `
    void main() {
      gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
    }
  `,
  attributes: {
    position: positionBuffer
  },
  vertexCount: 4
});
model.draw();

Other packages similar to @luma.gl/core

Keywords

webgl

FAQs

Package last updated on 16 Apr 2025

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