🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

glsl-barrel-pincushion

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glsl-barrel-pincushion

Distort UV using barrel or pincushion

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
0
Created
Source

glsl-barrel-pincushion

stable

Distort the UV with barrel or pincushion effect. Adapted from this shadertoy.

glsl-barrel-pincushion

Installation :package:

npm i glsl-barrel-pincushion -S

Usage :book:

barrelPincushion(vec2 st, float strength)

strength > 0 for barrel distortion, strength < 0 for pincushion.

Example :floppy_disk:

uniform float uTime;
#pragma glslify: barrelPincushion = require(glsl-barrel-pincushion)
#pragma glslify: rectangle = require(glsl-2d-primitives/rectangle)

attribute vec2 vUv;

void main() {
    vec2 st = barrelPincushion(vUv, sin(uTime));
    float shape = rectangle(st, vec2(0.5));
    gl_FragColor = vec4(color, shape);
}

Demo

License :pencil:

MIT. See LICENSE for details.

Keywords

glsl

FAQs

Package last updated on 28 Oct 2024

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