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: https://gist.github.com/runewake2/fca1ed77c835505f382fe57c5e812fe1

This video is a continuation of the previous Transformation Matrix Vertex Shader video. You can watch it here: https://www.youtube.com/watch?v=VzhxginBhdc

The Summer Slow Jams Performance Jam starts tomorrow! Join the fun here: http://jams.gamejolt.io/SSJperformance

Discord: https://discord.gg/hU5Kq2u


Sam Wronski
WRITTEN BY
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!