3D t-shirt from two flat photos (distance-field depth)

Made this for a WooCommerce product designer I’m building. No 3D model, just a front and a back product photo with a transparent background.

turn-60-key

  • outline from the alpha channel (marching squares)
  • depth from an exact distance transform: a rounded rim near the seam plus a gentle curve across the body
  • the back is the same mesh pushed the other way, back photo mirrored, sharing the edge vertices
  • the customer’s design goes on in the fragment shader, lit by the cloth’s own light from the photo, so folds run through the print

It loads only when someone presses 3D and renders only while it moves.

Try it: PrintBlob – Free Product Designer Plugin for WooCommerce
Write-up: Turning a flat product photo into 3D with a distance field - DEV Community

Curious how others have done 3D from 2D for product previews.