Hacker News new | past | comments | ask | show | jobs | submit login
Dither stabilisation (tigsource.com)
291 points by robin_reala on Nov 23, 2017 | hide | past | favorite | 20 comments



The dithered highlight on the sphere looks odd because it was calculated in a non-linear colorspace. You can get better looking results by converting to a linear colorspace, dithering, then converting back to sRGB. Eg, in ImageMagick, using the same 8x8 matrix:

convert Dither2-Exp_crop_resize.png -colorspace RGB -ordered-dither o8x8,2 -colorspace sRGB Dither2-Exp_dithered.png

Result: https://imgur.com/a/81bNg


Although in this case, the conversion back to sRGB is just the identity…


True. But if the dither mask was computed without taking into account sRGB's nonlinearity (which I assume it was), then the algorithm will have the same incorrect output.


I think the problem now is that the dithering is no longer done on the screen space, but instead looks like a texture slapped on top of the objects in orthogonal projection. You can easily notice it in the comparison shots; you'll notice that the sphere projection is angled at around 20-30 degrees, and it's not pixel-perfect on the screen as the original effect is.

I'm not a fan, to be fair.


Yeah, I couldn't agree more. The original effect is really interesting and evokes nostalgia of old Mac games, as the developer intended. I think he's reacting too harshly to criticism, or overthinking things, because my reaction to the pixel swimming effect matched his first assumption: "yeah that's how dither works."

The screen-space solution for stable dithering looks fine, and I'm glad it will be an option in the final game, but the sphere mapping looks weird. With non-screen-aligned "pixels" it looks like it's just a normal 3D game but with a "dither" texture on every object, rather than a true 1-bit game. I just hope the aesthetic from the demo isn't watered down too much for the final game.


The original effect is how it's supposed to look and how it would have looked on an old computer with 1-bit graphics.

If there is an option to choose between the different effects, I would personally go with the first one, because that's exactly how I remember old games looking.


yeah looks strange; I think motion blur to reduce "discomfort" when rotating the camera may have been a better compromise; or maybe removing all single-out black pixels (e.g. those with no adjacent black pixels in a 4x4 radius).


This post is written by the creator of the wonderful game Papers, Please.


I replied on the original thread too, but I wonder if it’d work to use a mipmapped dither texture in texture space like this old hatching paper: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.28.... It probably won’t give you exact 1 pixel dither without some hacks, but maybe something along those lines could work.


That is really cool, especially for the time. Only downside is I think some uv mapping is required to map the hatching onto the models. Here is a video of the paper https://www.youtube.com/watch?v=g6Ta35AiE1I


instead of using textures and downsampling them, would a mathematical formula for the dither pattern applied in the shader work best?


What a delightful attention to detail! I love this!

It is totally not weird to me to spend time on something with the goal for it not to be noticed in the end.



I wonder how using error diffusion on the time axis would look, I guess it would stabilise the image a bit.


Wouldn't error diffusion result in the opposite of stabilisation?


It would look like sensor noise ?


Noise has samples that are statistically independent from each other. Diffusion has samples such that their increments are independent. But it's path dependent.


This is the approach I'd use...

* Take the previous frame.

* Warp to the shape of the new frame using motion vectors.

* Dither the new frame using the warped old frame to modulate the white/black threshold when carrying forward the error to the next pixel.

That will lead to a pixel remaining white/black, and only a minimal number of pixels changing color between frames.


I couldn't find out why he wanted a 1 bit image. Was there a reason other than "it looks cool"?


From the first post of the forum thread:

"My first computer was a Mac Plus. I've always had a nostalgia-softened spot in my heart for 1-bit graphics. I'd like to capture the detailed black & white look of old Mac games in a realtime 1st person game."




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: