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

regl-feedback

v1.0.0

Published

visual feedback effect for regl meshes

Downloads

18

Readme

#regl-feedback

add a visual feedback effect to your regl mesh.

effect

##example

in this example we'll add a glowing feedback-based effect to the bunny in the bunny.js regl example.

view this demo

const regl = require('regl')()
const bunny = require('bunny')
const normals = require('angle-normals')
const camera = require('regl-camera')(regl, {
  center: [0, 5, 0],
  distance: 20,
  theta: 1.0,
  phi: 0.7 
})
var feedback = require('./feedbackeffect.js')
var drawfeedback = feedback(regl, `
  vec3 sample (vec2 uv, sampler2D tex) {
    return 0.97*texture2D(tex, (0.99*(2.0*uv-1.0)+1.0)*0.5).rgb;
  }
`)
const feedBackTexture = regl.texture({})
const drawBunny = regl({
  frag: `
    precision mediump float;
    varying vec3 vnormal;
    void main () {
      gl_FragColor = vec4(abs(vnormal), 0.2);
    }`,
  vert: `
    precision mediump float;
    uniform mat4 projection, view;
    attribute vec3 position, normal;
    varying vec3 vnormal;
    void main () {
      vnormal = normal;
      gl_Position = projection * view * vec4(position, 1.0);
    }`,
  attributes: {
    position: bunny.positions,
    normal: normals(bunny.cells, bunny.positions)
  },
  elements: bunny.cells,
  blend: {
    enable: true,
    func: { src: 'src alpha', dst: 'one minus src alpha' }
  },
  cull: { enable: true }
})
regl.frame(() => {
  regl.clear({ color: [0, 0, 0, 1] })
  drawfeedback({texture: feedBackTexture})
  camera(() => {
    drawBunny()
    feedBackTexture({ copy: true, min: 'linear', mag: 'linear' })
  })
})

##api

var feedback = require('regl-feedback')

###var drawfeedback = feedback(regl, src)

regl is a regl instance.

src is a string that contains the glsl code that defines your feedback effect.

in your glsl code you should describe a sample function (described below).

###vec3 sample (vec2 uv, sampler2D tex)

vec2 uv is the screen coordinates from 0 to 1.

sampler2D tex is the texture containing the pixels from the screen.

your sample function should return an rgb vec3. you can use texture2D to sample from the texture object.

###drawfeedback({texture: feedBackTexture})

this draws the feedback with the sample effect applied to it. it samples from feedBackTexture.

you can create the feedBackTexture by calling regl.texture({}).

##run the example on your own machine

the below instructions are entered via command line (the "terminal"). you will need to have node.js and npm installed for this to work.

first clone this repository to your own computer.

then run npm install while you're in the repository directory.

run budo example.js and wait until you see some output that looks like this:

[0006] info Server running at http://192.168.2.12:9966/ (connect)

then point your browser to localhost:9966.

##install

npm install regl-feedback

##license

BSD

##acknowledgments

thank you to substack and mikola lysenko for all of your help!