Socket
Book a DemoInstallSign in
Socket

glsl-scale-linear

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glsl-scale-linear

A linear scale for glslify

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

glsl-scale-linear

stable

A linear scale for glslify.

Usage

NPM

scale(float value, vec2 domain)

Returns a value between 0 and 1, depending on where along the scale value lies between domain.x (min) and domain.y (max).

#pragma glslify: scale = require('glsl-scale-linear')

float min   = 0.0;
float max   = 1000.0;
float value = 100.0;

float t = scale(value, vec2(min, max));

scale(float value, vec2 domain, vec2 range)

Similar to the above signature, however returns a value between range.x and range.y instead of 0 and 1. Shorthand for mix(range.x, range.y, scale(...)).

float t = scale(value, vec2(min, max), vec2(0.0, 1.0));

Contributing

See stackgl/contributing for details.

License

MIT. See LICENSE.md for details.

Keywords

ecosystem:stackgl

FAQs

Package last updated on 16 Jun 2015

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