I wanted to create a simple jigsaw game, but with a special focus on procedural puzzle piece generation. The result is an algorithm that procedurally generates unique puzzle piece shapes that can differ with every game.
The general idea is to slice up an arbitrary input image into small puzzle pieces. I experimented with various edge shapes.
I extruded the pieces into 3D shapes, and then enhanced the shading:
I tapered the edges outwards to give a nice 3D effect:
Arbitrary-sized grids are supported:
For added difficulty, I implemented piece rotation: