# glslCanvas
**Repository Path**: kongfu/glslCanvas
## Basic Information
- **Project Name**: glslCanvas
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 2
- **Created**: 2025-03-26
- **Last Updated**: 2025-03-26
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
[GlslCanvas](https://github.com/patriciogonzalezvivo/glslCanvas) is JavaScript Library that helps you easily load GLSL Fragment and Vertex Shaders into an HTML canvas. I have used this in my [Book of Shaders](http://thebookofshaders.com) and [glslEditor](http://editor.thebookofshaders.com).
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4BQMKQJDQ9XH6)
## How to use it?
There are different ways to do this. But first, make sure you are loading the latest version of ```GlslCanvas.js``` on your page by adding this line to your HTML:
```html
```
or if you are using npm package manager on your console do:
```bash
npm install glslCanvas
```
### The easy way
1. Create a canvas element in your HTML.
2. Add the class name ```glslCanvas``` to the canvas.
3. Assign it a shader...
* through a url using the attribute ```data-fragment-url```
* or directly writing your code inside the ```data-fragment``` attribute
```html
```
That's all! glslCanvas will automatically load a WebGL context in that ```