Skip to main content
100%

blend-alpha

✓ Published0🌍 Public
11wheel
Last edited Dec 7, 2017
Created on Dec 7, 2017

A WebGL animation renders 100,000 points as white and magenta dots with partial transparency, blending between two spatial distributions. The points cycle between uniform random placement and a non-linear transformation of that data, with an easing function controlling the interpolation. Using regl’s blending API, the code explores how alpha compositing behaves under high-density overlay, demonstrating the visual darkening and lightening effects that occur with increasing point overlap.

AI-generated description

I can't figure out why points with gl_FragColor = vec4(255, 255, 255, .1); get darker and then lighter when overlaid with increasing density.

I'm using these blending settings:

blend: {
  enable: true,
  func: {
    srcRGB: 'src alpha',
    srcAlpha: 1,
    dstRGB: 'one minus src alpha',
    dstAlpha: 1
  },
  equation: {
    rgb: 'add',
    alpha: 'add'
  },
  color: [0, 0, 0, 0]
},

Tweaking them hasn't fixed the problem, but I'm not sure what I'm doing...

Similar vizzes