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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@y11i-3d/tsl-psrdnoise

v1.1.2

Published

TSL port of psrdnoise.

Readme

TSL port of psrdnoise

npm version Build

This is a TSL (Three.js Shading Language) implementation of psrdnoise, ported from the original GLSL source.

Special thanks to Stefan Gustavson and Ian McEwan for the original implementation. https://github.com/stegu/psrdnoise/

MIT License:
Copyright (C) 2021 Stefan Gustavson and Ian McEwan (Original GLSL)
Copyright (C) 2026 Yuichiroh Arai (TSL port of GLSL)

Demo

https://y11i-3d.github.io/tsl-psrdnoise/

Installation

npm install @y11i-3d/psrdnoise

Usage

Noise only

import { uv } from "three/tsl";
import { psrdNoise2 } from "@y11i-3d/tsl-psrdnoise";

material.colorNode = psrdNoise2(uv()).mul(0.5).add(0.5);

With derivatives

psrddNoise2 and psrddNoise3 return the noise value along with its derivatives. They must be called inside a Fn() callback.

import { Fn, uv } from "three/tsl";
import { psrddNoise2 } from "@y11i-3d/tsl-psrdnoise";

material.colorNode = Fn(() => {
  const { noise, gradient, dg } = psrddNoise2(uv());
  return noise.mul(0.5).add(0.5);
})();

setLayout

Since psrdNoise2 and psrdNoise3 do not use setLayout, they are not compiled as shader functions — passing undefined for period or rotation excludes their corresponding shader code.
To use them as a reusable shader function with a specific combination of arguments, wrap them with Fn and setLayout:

import { Fn, uv, vec2 } from "three/tsl";
import type { Node } from "three/webgpu";
import { psrdNoise2 } from "@y11i-3d/tsl-psrdnoise";

const myNoise = Fn(([pos, period]: [Node<"vec2">, Node<"vec2">]) =>
  psrdNoise2(pos, period),
).setLayout({
  name: "myNoise",
  type: "float",
  inputs: [
    { name: "pos", type: "vec2" },
    { name: "period", type: "vec2" },
  ],
}) as (pos: Node<"vec2">, period: Node<"vec2">) => Node<"float">;

material.colorNode = Fn(() => {
  return myNoise(uv(), vec2(4, 4)).mul(0.5).add(0.5);
})();

API

| Function | Returns | Requires Fn() | | -------------------------------------- | ------------------------------ | --------------- | | psrdNoise2(pos, period?, rotation?) | float | No | | psrdNoise3(pos, period?, rotation?) | float | No | | psrddNoise2(pos, period?, rotation?) | { noise, gradient, dg } | Yes | | psrddNoise3(pos, period?, rotation?) | { noise, gradient, dg, dg2 } | Yes |