glsl-pi

1.0.0 • Public • Published

glsl-pi

locked

π available at your convenience for use within glslify.

Usage

NPM

PI = require('glsl-pi')

This package exports the value of Pi as supplied by google: 3.14159265359. You can use it like so:

#pragma glslify: PI require('glsl-pi') 
 
uniform float time;
 
void main() {
  gl_FragColor = vec4(vec3(PI * 2.0 * time), 1);
}

This is a really simple package but it saves me having to lookup/copy/paste the value every time. Also a useful alternative to using #define PI that's less leaky :)

Contributing

See stackgl/contributing for details.

License

MIT. See LICENSE.md for details.

/glsl-pi/

    Package Sidebar

    Install

    npm i glsl-pi

    Weekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • dy
    • archmoj
    • hughsk
    • mikolalysenko
    • substack
    • mattdesl
    • chrisdickinson
    • yoshuawuyts
    • mikkoh
    • rezaali
    • tatumcreative
    • wwwtyro
    • thibauts
    • bpostlethwaite
    • dfcreative
    • erkaman
    • gre
    • rreusser
    • vorg