# @vis-three/plugin-webgl-renderer

> webgl 渲染器插件。

Latest version **0.7.0** (published 2024-09-11) · MPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install @vis-three/plugin-webgl-renderer
pnpm add @vis-three/plugin-webgl-renderer
yarn add @vis-three/plugin-webgl-renderer
bun add @vis-three/plugin-webgl-renderer
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.7.0 |
| Published | 2024-09-11 |
| First published | 2023-03-28 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 24.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shiotsuki_ |
| Maintainers | shiotsuki_ |

## Links

- npm: https://www.npmjs.com/package/@vis-three/plugin-webgl-renderer
- npm.io page: https://npm.io/package/@vis-three/plugin-webgl-renderer

## Dependencies (2)

- [@vis-three/core](https://npm.io/package/@vis-three/core.md) ^0.7.0
- [@vis-three/utils](https://npm.io/package/@vis-three/utils.md) ^0.7.0

## Recent versions

- 0.7.0 (latest) — 2024-09-11
- 0.6.1 — 2023-05-06
- 0.6.0 — 2023-03-28

## README

# @vis-three/plugin-webgl-renderer

webgl 渲染器插件。

## 最新版本

<img alt="version" src="https://img.shields.io/npm/v/@vis-three/plugin-webgl-renderer">

## license

<img alt="NPM" src="https://img.shields.io/npm/l/@vis-three/plugin-webgl-renderer?color=blue">

## 插件名称

`WebGLRendererPlugin`

:::tip
可以使用枚举：`WEBGL_RENDERER_PLUGIN`
:::

## 插件依赖

无

## 插件传参

```ts
export interface WebGLRendererParameters {
  /**
   * A Canvas where the renderer draws its output.
   */
  canvas?: HTMLCanvasElement | OffscreenCanvas | undefined;

  /**
   * A WebGL Rendering Context.
   * (https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext)
   * Default is null
   */
  context?: WebGLRenderingContext | undefined;

  /**
   * shader precision. Can be "highp", "mediump" or "lowp".
   */
  precision?: string | undefined;

  /**
   * default is false.
   */
  alpha?: boolean | undefined;

  /**
   * default is true.
   */
  premultipliedAlpha?: boolean | undefined;

  /**
   * default is false.
   */
  antialias?: boolean | undefined;

  /**
   * default is true.
   */
  stencil?: boolean | undefined;

  /**
   * default is false.
   */
  preserveDrawingBuffer?: boolean | undefined;

  /**
   * Can be "high-performance", "low-power" or "default"
   */
  powerPreference?: string | undefined;

  /**
   * default is true.
   */
  depth?: boolean | undefined;

  /**
   * default is false.
   */
  logarithmicDepthBuffer?: boolean | undefined;

  /**
   * default is false.
   */
  failIfMajorPerformanceCaveat?: boolean | undefined;
}
```

## 引擎拓展

```ts
export interface Screenshot {
  width?: number;
  height?: number;
  mine?: string;
}
export interface WebGLRendererEngine extends Engine {
  /**webgl渲染器 */
  webGLRenderer: WebGLRenderer;
  /**获取webGL渲染截图 */
  getScreenshot: (params?: Screenshot) => Promise<string>;
}
```

## WebGLRenderer

参照：[https://threejs.org/docs/index.html#api/zh/renderers/WebGLRenderer](https://threejs.org/docs/index.html#api/zh/renderers/WebGLRenderer)

---
_Source: https://npm.io/package/@vis-three/plugin-webgl-renderer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
