🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@maptalks/fusiongl

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@maptalks/fusiongl

[![Build Status](https://travis-ci.com/axmand/fusion.gl.svg?token=N2z4DqiFgBjde7FHSBe3&branch=master)](https://travis-ci.com/axmand/fusion.gl) [![npm version](https://badge.fury.io/js/fusion.gl.svg)](https://badge.fury.io/js/fusion.gl) <!--[![codecov](htt

npmnpm
Version
0.124.3
Version published
Weekly downloads
1.3K
150.98%
Maintainers
1
Weekly downloads
 
Created
Source

fusion.gl

Build Status npm version

一个WebGL沙盒库,它能基于同一个WebGL Context,扩展出多个沙盒WebGL环境,方便不同WebGL框架共享同一个WebGL Context。

它的主要特性:

  • 模拟了全部WebGL1和部分WebGL2接口
  • 每个沙盒WebGLContext的状态管理
  • 切换沙盒时,自动设置WebGL Context上的状态值,例如stencil,depth,blend的相关状态
  • 性能提升,如果检测到某个WebGL语句设置的状态已经被设置过,则不去运行该指令

示例程序

import { GLContext } from '@maptalks/fusiongl';

const options = { alpha: true, depth: true };
const gl = canvas.getContext('webgl', options);
gl.wrap = () => {
  return new GLContext(this.gl);
};

// 在fusion.gl中的沙盒Context上创建Three的renderer
const renderer = new THREE.WebGLRenderer({ 'context': gl.wrap(), alpha: true });

FAQs

Package last updated on 11 Feb 2026

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