In this video, I show how to make a polygon shape using Affinity Photo's procedural texture filter.
Polygon:
var s=360/n; var v=vec2(rx,ry)*a/w; var th=atan2(v.y,v.x)+ph; var tp=th-s*floor(th/s+.5); osc(length(v)*cos(tp))
I originally saw this formula in "The Book of Shaders."
https://thebookofshaders.com/07/
Shader Polygon using Affinity Photo's Procedural Texture Filter
https://youtu.be/apZnZsDdXTs?si=fB6m0_YOSt8z7LAY
Procedural Textures Playlist:
https://www.youtube.com/playlist?list=PLPTJk1HIMN35WOCDXnoUB-l2_YVgJ8rHK
The Procedural Texture filter and related information can be found on Affinity Photo's website:
https://affinity.help/photo2/en-US.lproj/pages/Filters/filter_proceduraltexture.html
0:00 Introduction
1:10 Making a vertical line in polar coordinates
2:16 Using the floor function to transform the angle
5:26 Implementing the polygon filter
10:15 Conclusion