Double buffer grey scale?

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
Lardo Boffin
Posts: 610
Joined: Sat Nov 26, 2016 1:42 am

Double buffer grey scale?

Post by Lardo Boffin » Tue May 09, 2017 7:59 am

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
ZX81 iss 1 (bugged ROM, kludge fix, normal, kit)
Iss 3 with ZXVid, another in nearly perfect box
TS 1000 iss 3, ZXPand AY, ZX8-CCB & ZX-KDLX
TS 1500
TS 2000
Spectrum 16k (iss 1 s/n 1499)
Spectrum 48k
Toastrack + DIVMMC future

User avatar
siggi
Posts: 751
Joined: Thu May 08, 2008 8:30 am
Location: Dauernheim, Germany
Contact:

Re: Double buffer grey scale?

Post by siggi » Tue May 09, 2017 8:19 am

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
My ZX81 web-server: online since 2007
http://zx81-siggi.endoftheinternet.org/index.html

nollkolltroll
Posts: 188
Joined: Sat Sep 27, 2014 7:02 pm
Location: Stockholm, Sweden

Re: Double buffer grey scale?

Post by nollkolltroll » Tue May 09, 2017 8:21 am

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.
/Adam

User avatar
gammaray
Posts: 247
Joined: Sun Apr 17, 2016 1:44 am
Location: Texas

Re: Double buffer grey scale?

Post by gammaray » Tue May 09, 2017 11:51 pm

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/
Finish what you start. Truth is over the mountaintop or six feet under.
4 x TS1000, 2 x TS1500 , 2 x timex 2040 printer, 1/2 x timex 2020 cassette deck, ZXPAND, ZeddyNET, ZXBlast..., unfinished Spectrum...

User avatar
marste
Posts: 97
Joined: Sun Aug 10, 2014 8:58 pm
Location: Italy
Contact:

Re: Double buffer grey scale?

Post by marste » Thu May 11, 2017 4:45 pm

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

User avatar
1024MAK
Posts: 1764
Joined: Mon Sep 26, 2011 9:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Double buffer grey scale?

Post by 1024MAK » Thu May 11, 2017 6:04 pm

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

User avatar
sirmorris
Posts: 2652
Joined: Thu May 08, 2008 4:45 pm
Location: oxon, uk

Re: Double buffer grey scale?

Post by sirmorris » Thu May 11, 2017 6:27 pm

There's a bit in 25thanni demo which uses the alternate frames greyscale flicker technique. I just remembered.
--=== ZXpand+ ... A more moderner all-in-one upgrade solution for ZX81 ===--
* SD/MMC storage * 32K Hires-capable RAM * AY sound chip * Joystick port * Serial *
* BASIC enhancements - plug & play * Reset button * Auto-boot facility *

Lardo Boffin
Posts: 610
Joined: Sat Nov 26, 2016 1:42 am

Re: Double buffer grey scale?

Post by Lardo Boffin » Thu May 11, 2017 9:30 pm

Thanks all. Interesting explanation about the TV flicker Mark!

I suspected at the start the idea wasn't going to work.
ZX81 iss 1 (bugged ROM, kludge fix, normal, kit)
Iss 3 with ZXVid, another in nearly perfect box
TS 1000 iss 3, ZXPand AY, ZX8-CCB & ZX-KDLX
TS 1500
TS 2000
Spectrum 16k (iss 1 s/n 1499)
Spectrum 48k
Toastrack + DIVMMC future

User avatar
GCHarder
Posts: 172
Joined: Sat Dec 14, 2013 6:46 pm

Re: Double buffer grey scale?

Post by GCHarder » Thu May 11, 2017 11:27 pm

gammaray wrote:
Tue May 09, 2017 11:51 pm
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

User avatar
GCHarder
Posts: 172
Joined: Sat Dec 14, 2013 6:46 pm

Re: Double buffer grey scale?

Post by GCHarder » Thu May 11, 2017 11:37 pm

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

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests