Page 1 of 2

Double buffer grey scale?

Posted: Tue May 09, 2017 8:59 am
by Lardo Boffin
I was playing around with double buffering in low res mode to get smoother animation and had an attack of the blindingly obvious - if I have a dark image in one buffer and a light image in the other is it possible to switch between them fast enough to fool the eye into thinking it is grey scale? Presumably you could vary the relative times the images are displayed to get a few different shades?
I gave it a go (emulator only so far) and the results varied from an almost reasonable grey scale one moment to a seizure inducing flashing pattern the other. I still have a headache...
Is this one of those ideas that sounds great but doesn't work? Given how obvious it is I would have assumed we would be knee deep in grey scale games by now if it did work.
Has anyone tried this and got anywhere?

Lardo

Re: Double buffer grey scale?

Posted: Tue May 09, 2017 9:19 am
by siggi
Hi Lardo
"grey" is possible and is a standard feature of the Z88DK graphic libs. But on ZX81, the screen flickers:

https://www.z88dk.org/wiki/doku.php?id=library:graylib

Regards
Siggi

Re: Double buffer grey scale?

Posted: Tue May 09, 2017 9:21 am
by nollkolltroll
It works, but it will always flash badly. On a proper CRT it looks slightly better than on the emulator though.
Z88dk has support for 2-bit greyscale according to their documentation, which gives 4 greyscales. Unfortunately it does this at a third of the basic framerate, so 50/3=16,67fps or 60/3=20fps. Seriously bad for your eyes.

Re: Double buffer grey scale?

Posted: Wed May 10, 2017 12:51 am
by gammaray
I remember back in the day someone was selling a game that flashed to create colors by stimulating the retina at different frequencies.

May be like when you stare at a an image for some time and then move to another the impression of color is given off.

https://petapixel.com/2015/11/16/trick- ... ull-color/

Re: Double buffer grey scale?

Posted: Thu May 11, 2017 5:45 pm
by marste
I think that the display screen change should be sincronized with the real display similarly as it is done in the flicker free tecnique used for ZX80

Re: Double buffer grey scale?

Posted: Thu May 11, 2017 7:04 pm
by 1024MAK
This idea of displaying different content for each pass of the "electron beam" (if a CRT) has been tried on various computers to increase the number of colours or shades.

The trouble is, how well or not it works does rather depend on the actual display (some CRTs work better than others, LCD displays usually give worse results) and the human looking at the display.

So often after the idea gets rediscovered, soon after, when it becomes clear that the flickering/flashing problem cannot be solved for most users, it gets abandoned again.

Things to keep in mind: the analogue TV system is full of compromises and is really only barely adequate to display moving pictures when the intensity of the "beam" (and hence the the intensity of a pixel) is continuously variable. The phosphor coating on a CRT is only designed to "hold" an image for long enough before the electron beam passes again. If phosphor coating had a longer persistence (like old style oscilloscopes or radar screens), moving TV images would become blurred.

So if you try to use the multiple pass technique so that an average pixel intensity is produced, by the time of your last pass, the amount of light from the CRT phosphor coating of the first pass will have decayed substantially. You are effectively reducing the displayed frame rate. Hence the flicker.

Mark

Re: Double buffer grey scale?

Posted: Thu May 11, 2017 7:27 pm
by sirmorris
There's a bit in 25thanni demo which uses the alternate frames greyscale flicker technique. I just remembered.

Re: Double buffer grey scale?

Posted: Thu May 11, 2017 10:30 pm
by Lardo Boffin
Thanks all. Interesting explanation about the TV flicker Mark!

I suspected at the start the idea wasn't going to work.

Re: Double buffer grey scale?

Posted: Fri May 12, 2017 12:27 am
by GCHarder
gammaray wrote: Wed May 10, 2017 12:51 am I remember back in the day someone was selling a game that flashed to create colors by stimulating the retina at different frequencies.

May be like when you stare at a an image for some time and then move to another the impression of color is given off.

https://petapixel.com/2015/11/16/trick- ... ull-color/
I tried this with mixed results, see

viewtopic.php?f=11&t=1705

Re: Double buffer grey scale?

Posted: Fri May 12, 2017 12:37 am
by GCHarder
See Fred Nachbaur's "Bi-Plot Demo" at

Http//www.pictureviewerpro.com/hosting/zx81/fredn.htm

"Bi-Plot demo" (16, WRX) This is a demonstration of a cool WRX16 display option. The 8K hi-res display file is divided into two 4K chunks, which are displayed on alternate frames to give a neat overlay effect. The lower six lines are standard low-res. Doesn't work as expected on ZX Emulator, needs a real ZX81 or TS1000/1500.

It does work in EO as I recall.

Regards;

Greg