Today we are deconstructing the 4-Star Dragon Ball shader (available on Shadertoy here). This shader is a good example of using 2D math to drive 3D optical effects. To understand it, we must reference the fundamental building blocks provided by Inigo Quilez. This shader is more than just a piece of fan art. I built this 4-Star Dragon Ball shader as a bridge between simple 2D shapes and complex 3D optics. If you’re looking for an introductory shader to study, this is a perfect playground because it moves past "drawing a box" and dives into how light behaves. What makes this unique as a study case is the Double March. Ww are treating the sphere as a physical lens. Once you hit the "glass," the shader calculates a bent path and starts a second march inside. It’s my attempt at playing with coordinate transformation. 1. Defining the Stars (2D SDFs) The internal stars are defined using 2D Signed Distance Functions. an SDF is a function that takes a point in space and returns the distance to…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.