npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

glsl-worley

v1.0.2

Published

Worley noise implementation for WebGL shaders

Downloads

1,060

Readme

glsl-worley

From this module, a GLSL implementation of Worley Noise written by Stefan Gustavson can be imported.

A demo can be found here

Usage

This module provides four functions, and they can be exported as

#pragma glslify: worley3D = require(glsl-worley/worley3D.glsl)
#pragma glslify: worley2x2x2 = require(glsl-worley/worley2x2x2.glsl)
#pragma glslify: worley2D = require(glsl-worley/worley2D.glsl)
#pragma glslify: worley2x2 = require(glsl-worley/worley2x2.glsl)

And then they can easily be used to generate a texture in a shader by doing something like:

  vec2 F = worley3D(vPosition, 1.0, false);
  float F1 = F.x;
  float F2 = F.y;
  gl_FragColor = vec4(vec3(F2-F1), 1.0);

worley3D is defined as vec2 worley3D(vec3 P, float jitter, bool manhattanDistance). It returns a vec2 where x is F1 and y is F2(it is assumed that the reader knows the meaning of these two). P is the input point, jitter is the amount of jitter in the pattern, and if manhattanDistance is true, then a manhattan distance is used to generate the pattern, instead of the usual Euclidean distance(this basically makes the noise appear more "jagged").

The remaining three functions take the same arguments, except that in the case of worley2D and worley2x2, P is a vec2.

worley2x2x2 is basically a faster version of worley3D. But be aware that it has some artifacts. In the same manner, worley2x2 is basically a faster version of worley2D, but with some potential artifacts.