Get the latest tech news

A flowing WebGL gradient, deconstructed


An introduction to writing WebGL shaders using gradient noise and cool math.

A GPU can invoke our color function thousands of times in parallel, making the task of rendering a single frame a breeze. As a first step, I’ll create a reusable wave_alpha function that takes in a position and height for the wave and returns an alpha value. You’ll notice that the wave becomes sharp when the chart gets close to touching the bottom — at values near zero — but it rarely dips that low.

Get the Android app

Or read this on Hacker News