6 ms·
Daily Driver: Channelling RGB into 1-bit
- pixel_tracing 5y agoIs there an implementation in this article?
- robflynn 5y agoThis appears to be a game (in development) for a handheld device I hadn't heard of. There are a few other posts about it on his blog. I didn't see any code, but it sounds like the post was detailing how he marks (manually) which section of his models will have a dither pattern -- basically just masking. There are a a bunch of posts about it if you go to his blog index, there are only 7 pages so it's easy enough to flip through them, they're all labeled with the DailyDriver name. There might be something in there about the render process.
- flobosg 5y ago> a handheld device I hadn't heard of It’s the upcoming Playdate, developed by Panic: https://play.date/ https://play.date/
- msephton 5y agoExactly, I'm just extracting masks from the channels in a way that is easy for me to specify through my render. For browsing my blog you can also click on the tags at the top of each post, which will show you other posts with the same tag. For my game that's: https://blog.gingerbeardman.com/tag/dailydriver/ https://blog.gingerbeardman.com/tag/dailydriver/
- msephton 5y agoThere isn't a runnable implementation, sorry. I only talk about it casually, at a high level. If there is interest in this sort of thing I will go back and detail it at a later date. However, I will be including more like this plus code, scripts, makefiles, etc in my "making of the game" book.
- syntaxing 5y agoDoesn't this mean you can have 16 shade of grey (or 8? without the alpha channel)? Is there an advantage to this compared to a 4 bit greyscale system? Edit: the Dither pattern implementation is really cool
- msephton 5y agoI haven't explored the total number of masks that could be pulled out of this setup, but it probably is around 8. I don't need that many, because I need to keep the number of colours low because of the 1-bit target display, and the tony size of my sprites (30x30px). So once I got enough to cater for black and white and another for a dither pattern I stopped there. I could easily get one more, but I've not needed it so far. https://twitter.com/gingerbeardman/status/1396131988793331713 https://twitter.com/gingerbeardman/status/139613198879333171...
- RodgerTheGreat 5y agoI applied a similar idea in a drawing application I wrote recently. You can paint and fill with 1-bit patterns, but since the underlying representation preserves a "color" index for each pixel, you can repeatedly flood fill, post-hoc edit patterns, and even animate the patterns: https://beyondloom.com/tools/ditherpaint.html https://beyondloom.com/tools/ditherpaint.html
- jart 5y agoWhat you've written is beautiful. I love that I'm drawing an image where the paintbrush behaves as an eraser. This project has perfect fidelity with the original MacPaint except better https://archive.org/details/mac_Paint_2 https://archive.org/details/mac_Paint_2 I upvoted your link. https://news.ycombinator.com/item?id=26517917 https://news.ycombinator.com/item?id=26517917 It deserves to be in HN's second chance pool.
- msephton 5y agoThis is great! I also get Classic Macintosh vibes from it. In fact, another of my projects is to use Classic Mac 1-bit drawing apps under emulation on an iPad Pro. Painting with dither patterns is so satisfying! I've done a few fine-art style pieces with this technique. https://blog.gingerbeardman.com/2021/04/17/turning-an-ipad-pro-into-the-ultimate-classic-macintosh/ https://blog.gingerbeardman.com/2021/04/17/turning-an-ipad-p...
- Scene_Cast2 5y agoWouldn't it be easier & more maintainable to use a nodes compositor? Something like blender, nuke, resolve, etc. Or, if custom shaders are needed, Shadron or similar.
- msephton 5y agoPossibly! Though I have no idea what any of those are.
- 0-_-0 5y agoI guess the alternative would be to compute everything in greyscale and use Floyd-Steinberg [0] or some other dithering algorithm to convert it to 1-bit color. [0]: https://en.wikipedia.org/wiki/Floyd%E2%80%93Steinberg_dithering https://en.wikipedia.org/wiki/Floyd%E2%80%93Steinberg_dither...
- rualca 5y agoThank you for pointing to Wikipedia's article on Floud-Steinberg. Cool stuff!
- 0-_-0 5y agoYou're welcome, there are many others: https://en.wikipedia.org/wiki/Dither#Algorithms https://en.wikipedia.org/wiki/Dither#Algorithms
- msephton 5y agoOriginally I was using greyscale and dithering (I have another bespoke tool for exploring a dozen or so dithering algorithms) but the results were less than ideal. Dithering works great at larger sizes, but with my final sprites being only 30x30px (much, much smaller than the example images in the blog post) the results were a mess. After the exploration with greyscale, as the blog post hopefully explains, I moved from to pulling out black and white separately - which gave better results - to this RGB Channel approach to generate the masks more easily. I have headroom to squeeze another colour by using the alpha channel as the base colour and using the free colour for some other detail. But so far I've not needed to. Though good to know it's there if I need it to be!