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

uber-noise

v0.2.2

Published

uber-noise is a advanced noise library for 2D, 3D and 4D noise generation. based on simplex-noise

Downloads

18

Readme

uber-noise

advanced noise generation for the browser and node.js

  • written in typescript
  • seeded noise
  • based on simplex noise (2D, 3D and 4D)
  • fractal brownian motion (fbm)
  • custom gain, lacunarity, scale, shift, power
  • billowed, ridged, warped, stepped noise
  • seamless tiling noise (1D and 2D)
  • most options can be set to own noise instance

Install

npm i uber-noise
import UberNoise from "uber-noise";

Usage

Basic

Get noise value

const noise = new UberNoise();

// get noise value at x, y, z
const value = noise.get(x, y, z);
// OR
const value = noise.get({x, y, z});

Set noise options

// simple fbm noise
const noise = new UberNoise({
  scale: 0.01,
  octaves: 4,
  gain: 0.5,
  lacunarity: 2.0,
});

Set noise options to noise instance

const noise = new UberNoise({
  // this will set the scale to a noise instance returning values between 0.01 and 0.1
  scale: { min: 0.01, max: 0.1, scale: 0.01 },
});

All options

| Option | Type | Default Value | Description | |---------------|----------------------------------|-------------------|----------------------------------------------------| | seed | string \| number | Math.random() | Seed for the noise, defaults to a random value. | | min | number \| UberNoise \| NoiseOptions | -1 | Minimum value of noise. | | max | number \| UberNoise \| NoiseOptions | 1 | Maximum value of noise. | | scale | number \| UberNoise \| NoiseOptions | 1 | Scale of the noise ("zoom" level). | | power | number \| UberNoise \| NoiseOptions | 1 | Power of the noise (1 = linear, 2 = quadratic). | | shift | number[] | [0, 0, 0, 0] | Move noise in 2D, 3D, or 4D space. | | octaves | number | 0 | Number of layers for fbm noise. | | gain | number \| UberNoise \| NoiseOptions | 0.5 | Amplitude multiplier per fbm layer. | | lacunarity | number \| UberNoise \| NoiseOptions | 2 | Scale multiplier per fbm layer. | | amps | number[] | [] | Array of custom amplitudes for each fbm layer. | | layers | NoiseOptions[] | [] | Custom noise options for each fbm layer. | | sharpness | number \| UberNoise \| NoiseOptions | 0 | Sharpness of noise (0 = normal, 1 = billowed, -1 = ridged). | | steps | number \| UberNoise \| NoiseOptions | 0 | Discretizes the noise into steps. | | warp | number \| UberNoise \| NoiseOptions | 0 | Amount to warp the noise. | | warpNoise | UberNoise | undefined | Custom noise used to warp the noise. | | warp2 | number \| UberNoise \| NoiseOptions | 0 | Second level of warping, only used if warp is used too. | | warpNoise2 | UberNoise | undefined | Second custom noise for additional warping. | | invert | boolean | false | Invert the noise output. | | abs | boolean | false | Take the absolute value of the noise. | | clamp | boolean | false | Clamp the noise between min and max values (otherwise noise might overflow slightly). | | tileX | boolean | false | Tile the noise in the x direction. | | tileY | boolean | false | Tile the noise in the y direction. | | tile | boolean | false | Tile the noise in x and y directions (overwrites tileX and tileY) |