Skip to content(if available)orjump to list(if available)

How to render a mesh gradient using RBF interpolation

olpyhn

Mesh gradients are a powerful way to create smooth, organic color transitions. Traditional techniques like spline-based interpolation or multiple overlapping radial gradients can be effective—but they also come with trade-offs: visual artifacts, complexity, or the need for structured meshes.

In this article, I’ll show you how to use Radial Basis Function (RBF) interpolation to generate seamless gradients from just a set of colored points. This approach is portable, flexible, and simple to implement.

smidgeon

RBFs are splendid, but you don't need to have them "decay with distance", indeed, ones which don't (mutliquartics etc) often have better approximation properties and better-conditioned linear systems to solve, give them a go! https://www.sciencedirect.com/science/article/abs/pii/S09557...

olpyhn

Interesting, will try it out. Thank you!

Tbh, I tried several different functions, but nothing worked better than inverse quadric function. Though, I'm not sure if I tried anything without decay

smidgeon

One interesting group is the compactly supported RBFs, for example those of Wendland https://math.iit.edu/~fass/603_ch4.pdf the advantage being that the resulting linear systems are sparse, useful when you have lots of points to interpolate and "gaps" is not an issue.