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

@luma.gl/core

Package Overview
Dependencies
Maintainers
6
Versions
244
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.0.19
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
158K
decreased by-26.11%
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

FAQs

Package last updated on 07 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