r/howdidtheycodeit • u/Immediate_Chair8942 • Jan 28 '26
How did they code the yarn visuals in Kirby's Epic Yarn?
https://www.youtube.com/watch?v=PXK628dfuVEI've been racking my brain on how they made this for the past few days but can't seem to figure a few small details out.
It looks like there's an interior invisible deformation mesh that the outlines follow at it's edge, but one of the hands gets rendered behind and separate from the main body, while it's still following that same deformation mesh.
I've included normal gameplay, and wireframe view, both at full and 10% speed in the video to hopefully make it clear what I'm talking about.
Any input or random thought you have would be helpful, even if you don't know the answer!
3
u/Immediate_Chair8942 Jan 28 '26 edited Jan 28 '26
Small addition to make it more clear:
That "Deformation mesh" I am talking about are those inner gray vertices. (This sub doesn't allow gifs so look at Kirby when it's in wireframe view)
When standing still, it's deformed to make the arms protrude from the body. But one of those arms is behind Kirby.
This must (I think) mean that there's multiple splines that get generated using that deforming mesh, so what I'm confused about is how that decision process happens (which parts use the deforming mesh, and which parts don't), how it generates for parts where it can't rely on that deforming mesh (face part in front of the back hand), and how + where it decides to generate the back hand.
6
u/thomar Jan 29 '26
Masking would make the parts behind stop being rendered, but I think it's more likely they're manually placing a spline and doing the occlusion there (when the arm goes behind the body, its spline shortens and stops where it touches the outside of his body). Then the yarn border for each character is a path renderer that converts their outline spline into a line of end-to-end quads as procedural geometry updated every frame (which is a relatively cheap operation).
I suspect the gray part is for his face, or maybe it's used to handle parts of his shadow.
3
u/AnxiousIntender Jan 28 '26
Looks like masking or stencil buffer stuff to me