3D Library (now with Textures!)

The 3D library that comes with the playdate SDK is pretty neat, but it has some limitations. For example, it cannot clip meshes at the camera boundary -- this means that any face which has even a single vertex that ends up with a negative Z coordinate after perspective is applied (i.e. ending up behind the camera) is culled entirely.

New Features

  • Textures, greyscale or monochrome.
  • Custom dither patterns (per object) -- you can see this in the checkered banner in the gif below
  • Mesh clipping -- meshes don't have to be fully in front of the camera anymore.
  • Imposters -- 2D sprites that always face the camera, like in Doom.

kart-textures

https://github.com/nstbayless/playdate-kart

Please feel free to contribute or use this in your game! PRs are very welcome. Also if you are interested in using this tech, please let me know, as that may inspire me to improve the library further.

10 Likes

Wow this is pretty amazing! Well done.

My idea for the 3D engine was to create a Golf game. I'll be sure to keep an eye on your project.

@dave what are your thoughts on integrating public changes to the 3D lib? something for GitHub or not?

1 Like

Update! I've added textures, imposters, and custom patterns. Here's the limit of what was possible before:

kart

8 Likes

I wonder if it'd be possible to lock the camera and create a kind of Paper Mario style of game using this method?