Glowing star

Calculate the distance of the point p from the radius r.

Calculate the distance of the point p from the star with radius r, and a relative value rf controlling the depth of the stars points.

val circleSDF = sdCircle(env.UV - 0.5f, 0.25f)

drawSdfCircle(circleSDF) // Simple SDF

drawSdfCircle2(circleSDF) // Using it as a cos wave

drawStarStep1(starSDF) // SDF

drawStarStep2(starSDF) // Annular

drawStarStep3(starSDF) // Glow