This page looks best with JavaScript enabled

Spherifying Our Vertex Shader

 ·   ·  ☕ 1 min read

Expanding a vertex shader by allowing us to Clamp the distance of the vertices to a fixed distance. This effectively allows us to limit the model to a “sphere” or part of a sphere if we reduce the limit far enough. Effectively we’re “Spherifying” our mesh!

This effect is super simple, it takes almost no code to accomplish but thanks to all the matrix modifications we have added it actually gives us quite a bit of power and it’s a lot of fun to play with!

You can grab the code from this video on GitHub here:

This video is a continuation of the previous Transformation Matrix Vertex Shader video. You can watch it here:

The Summer Slow Jams Performance Jam starts tomorrow! Join the fun here:


Sam Wronski
Sam Wronski
Maker of things, currently helping build cloud things @ Google. World of Zero is a personal project disconnected from my professional work. Lets make something awesome together!