This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float arcRadius = length(p); | |
// Compute the radial distance field coming out from the center of a torus | |
const float hw = (RadiusOuter-RadiusInner)*0.5; // half width from center of torus to edge | |
float radialDF = arcRadius - (RadiusOuter-hw); // creates a torus | |
radialDF = abs(radialDF)-hw; // give an inside and outside to the torus | |
// Compute the gradient along the length of the arc | |
float arcGradient = atan2(p.y,p.x)/6.283185; | |
arcGradient = frac(arcGradient*NumDashes); |