Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/riccardoscalco/glsl-rectangular-function
Glsl implementation of the rectangular function.
https://github.com/riccardoscalco/glsl-rectangular-function
glsl glslify math rectangular step webgl
Last synced: 2 days ago
JSON representation
Glsl implementation of the rectangular function.
- Host: GitHub
- URL: https://github.com/riccardoscalco/glsl-rectangular-function
- Owner: riccardoscalco
- License: mit
- Created: 2019-05-30T21:20:19.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T20:39:46.000Z (over 3 years ago)
- Last Synced: 2024-09-19T11:49:58.452Z (14 days ago)
- Topics: glsl, glslify, math, rectangular, step, webgl
- Language: GLSL
- Size: 50.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# glsl-rectangular-function
Glsl implementation of the [rectangular function](https://en.wikipedia.org/wiki/Rectangular_function).
## Install
```sh
npm install glsl-rectangular-function
```## Usage
```glsl
#pragma glslify: rectangularFunction = require(glsl-rectangular-function)void main() {
vec2 p = gl_FragCoord.xy / resolution.xy;float center = 0.5;
float width = 0.25;
float y = rectangularFunction(p.x, center, width);gl_FragColor = vec4(vec3(y), 1.0);
}
```