14 votes

What programming/technical projects have you been working on?

This is a recurring post to discuss programming or other technical projects that we've been working on. Tell us about one of your recent projects, either at work or personal projects. What's interesting about it? Are you having trouble with anything?

8 comments

  1. [3]
    tesseractcat
    Link
    Quite a while ago I backed the Looking Glass Portrait, and it arrived about a week ago. It's a really cool piece of tech, which uses lenticular lenses to split the screen into 45-100 different...

    Quite a while ago I backed the Looking Glass Portrait, and it arrived about a week ago. It's a really cool piece of tech, which uses lenticular lenses to split the screen into 45-100 different views, to create a very convincing 3d effect.

    To render these views, you use the 'quilt' format, which is basically just a grid of views (which looks something like this). This is then transformed into content that the lenticular lenses can render via a pixel shader, which looks like this. Each unit has a different set of calibration values, which need to be fed to the pixel shader for it to render the quilt correctly.

    One thing that's super cool about it is that it has a built in Raspberry Pi 4B, which allows it run standalone. Although, the only standalone content it supports is pre-rendered mp4 files. They have some plugins for various 3d engines, like Unity and Unreal, which allow you to render real time content, however it requires being connected to a pc of some sort.

    I wanted to try running realtime content on the Raspberry Pi, so I opened it up and took out the stock MicroSD card, and put in my own (which was loaded with stock RPI OS Lite). I was able to get it to boot, and SSH into it.

    Obviously you can't run Unity or Unreal on a Pi, so my choices for rendering were pretty limited. I didn't want to use pure OpenGL, but I still wanted more low-level control to fine-tune performance. In the end I chose raylib, which is pretty close to the metal, and supports the Raspberry Pi out of the box.

    I learned a lot about the Raspberry Pi rendering stack while working on the project. It turns out that you don't need an X Server to render stuff, you can use something called KMS and DRM (direct rendering manager) to render directly with GPU acceleration (see https://github.com/freedesktop/mesa-kmscube). But this is complicated by the fact that there are two different graphics drivers for the pi, "vc4-fkms-v3d" ("fake" kms) and "vc4-kms-v3d" (kms). I'm not quite sure what the difference is, but the kms version is more performant, but more experimental.

    With the kms driver and raylib, I could render a cube at 3360x3360 (48 views at 8x6) at about 20fps, but rendering 3+ would drop the framerate significantly. With instancing support, I can render a few dozen cubes (or a few hundred quads) without a significant drop in framerate. Without the fullscreen lenticular shader, I was able to get around 30 fps with the same scenes. The lenticular shader needs to make multiple texture calls, with seems to be the culprit (but are necessary).

    Note that: the current release of Mesa drivers for the Pi (19.3.2) supports OpenGL ES 3.1, which seems to support instancing, however raylib only supports OpenGL ES 2.0. Despite that, it was pretty easy to just search and replace GLES2 with GLES3.

    Here are some GIFs of stuff I got working:

    9 votes
    1. Apos
      Link Parent
      This is so fascinating! I didn't know displays like that existed. I remember looking at Lenticular images, it's so cool that we can now have dynamic ones. With your display, you have access to 48...

      This is so fascinating! I didn't know displays like that existed. I remember looking at Lenticular images, it's so cool that we can now have dynamic ones.

      With your display, you have access to 48 angles? 😍

      4 votes
    2. sqew
      Link Parent
      Saw Linus Tech Tips' video on the device a week or two ago. Very cool tech, and you're doing even cooler stuff with it. Amazing work!

      Saw Linus Tech Tips' video on the device a week or two ago. Very cool tech, and you're doing even cooler stuff with it. Amazing work!

  2. [3]
    Artemix
    Link
    A small project release page generator whose goal was to be simple and straightforward for my needs.

    A small project release page generator whose goal was to be simple and straightforward for my needs.

    2 votes
    1. [2]
      Apos
      Link Parent
      Nice! Do you have an example where you used it?

      Nice! Do you have an example where you used it?

      1. Artemix
        Link Parent
        Still not developed, but I will use it for my projects, for example gitmgr, a barebones git repository manager (content warning: the page itself is fully SFW, but the rest of the website isn't).

        Still not developed, but I will use it for my projects, for example gitmgr, a barebones git repository manager (content warning: the page itself is fully SFW, but the rest of the website isn't).

  3. tomf
    Link
    I've been working on a book tracking spreadsheet. I've got about four or five iterations, but none of them work very well.. until now! I'm still tweaking it, but here's the overly complicated...

    I've been working on a book tracking spreadsheet. I've got about four or five iterations, but none of them work very well.. until now! I'm still tweaking it, but here's the overly complicated process...

    1. I mark some books on Goodreads as 'want to read'
    2. the RSS feed for my 'shelves' goes through IFTTT to a spreadsheet
    3. I then use some regex to pull out the author, title, date, and series info (the most important part of this piece)

    Next up I dump a combination of author and title into a text file and run isbntools on it, this pulls up to five records per search, which is plenty.

    I have a QUERY around the import of the file to return complete sets of data. Align all that and I'm pretty much made in the shade.

    I'm still working on it, but the overall process should be fairly streamlined in the near future. Its all fairly hacky... but I'm fine with that. :)

    ISBN sucks. What we need is one ID for each title, then have sub-IDs for each publishing.

    2 votes
  4. jcdl
    Link
    I just started a new job at Suborbital where I've been working on a bunch of our open source WebAssembly-related toolchain.

    I just started a new job at Suborbital where I've been working on a bunch of our open source WebAssembly-related toolchain.

    1 vote