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