surface filament ( float frequency = 5.0, phase = 0.0, width = 0.15 ) { /* Calculate the distance of (s,t) from a spiral as a fraction [0,1] */ float offset = mod((t*frequency + s + phase), 1.0); /* Threshold the fraction against the fractional filament width */ if (offset < width) { Ci = 0.0; Oi = 1.0; } else { Ci = 0.0; Oi = 0.0; } }