glsl-scale-log
A logarithmic scale for glslify
Last updated 5 years ago by hughsk .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install glsl-scale-log 
SYNC missed versions from official npm registry.

glsl-scale-log

stable

A logarithmic scale for glslify.

Usage

NPM

scale(float base, 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).

base is the logarithmic base to use.

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

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

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

scale(float base, 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(base, value, vec2(min, max), vec2(0.0, 1.0));

Contributing

See stackgl/contributing for details.

License

MIT. See LICENSE.md for details.

Current Tags

  • 1.0.0                                ...           latest (5 years ago)

1 Versions

  • 1.0.0                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |