# webgl-example

> The examples are used on Gandis Blog

Latest version **0.0.4** (published 2021-02-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install webgl-example
pnpm add webgl-example
yarn add webgl-example
bun add webgl-example
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2021-02-08 |
| First published | 2021-01-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 41.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | gandis |
| Maintainers | gandis |
| Keywords | 3d, webgl, mesh, image, volume, graphics, rendering |

## Links

- npm: https://www.npmjs.com/package/webgl-example
- Repository: https://github.com/gandis0713/webgl-example
- Homepage: https://github.com/gandis0713/webgl-example#readme
- Issues: https://github.com/gandis0713/webgl-example/issues
- npm.io page: https://npm.io/package/webgl-example

## Dependencies (2)

- [gl-matrix](https://npm.io/package/gl-matrix.md) ^3.3.0
- [shader-loader](https://npm.io/package/shader-loader.md) ^1.3.1

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2021-02-08
- 0.0.3 — 2021-02-06
- 0.0.2 — 2021-02-01
- 0.0.1 — 2021-01-31
- 0.0.0 — 2021-01-27

## README

# webgl-example

[![Build Status](https://github.com/gandis0713/webgl-example/workflows/Build%20and%20Test/badge.svg)](https://github.com/gandis0713/webgl-example/workflows/Build%20and%20Test/badge.svg)
![npm-download](https://img.shields.io/npm/dm/webgl-example.svg)
![npm-version-requirement](https://img.shields.io/badge/npm-6.14.10-brightgreen.svg)
![yarn-version-requirement](https://img.shields.io/badge/>=yarn-1.22.0-brightgreen.svg)
![node-version-requirement](https://img.shields.io/badge/node-14.15.4-brightgreen.svg)

Introduction
============

webgl-example is an open source for implementing basic examples such as 3D Rendering, Image Processing, Light Effect, etc. It started for easily apply to a blog or web site.


Requirements
============
- Node 14.15.4
- NPM 6.14.10
- YARN 1.22.0+


Concept
=======

webgl-example has a very simple structure and has three representative components.
- **Renderer** is responsible that rendering objects.
- **Action** is responsible that for user interaction and control a view(**Renderer**) and objects.
- **Window** has a renderer and an action, provides function APIs to the user.

How to use
==========
- **Package Manager**
~~~shell
$ npm i webgl-example
~~~
~~~Javascript
import SharpenImageWindow from 'webgl-example/src/window/SharpenImageWindow';

const imageWindow = new SharpenImageWindow(HTMLElement);
const image = new Image();
image.src = "<Image resource address>";
image.addEventListener('load', function() {
    imageWindow.setImage(image);
});
~~~

- **Bundle**
~~~HTML
<script src="./webgl-example.bundle.js"></script>
<script>
    window.addEventListener('load', function() {
        const divElement = document.getElementById("divElement");
        const imageWindow = new webglexample.window.EdgeImageWindow(divElement);
        const image = new Image();
        image.src = "<Image resource address>";
        image.addEventListener('load', function() {
            imageWindow.setImage(image);
        });
    });
</script>
<body>
    <div id="divElement"></div>
</body>
~~~
Configure
=========
- Webpack
~~~webpack
rules: [
    {
        test: /\.glsl$/,
        use: [ 'shader-loader' ]
    },
]
~~~

Examples
========
- [Image Processing](https://github.com/gandis0713/webgl-example/tree/master/examples/image)

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