Author Topic: Why does axe greyscale look so bad at very high speeds?  (Read 3847 times)

0 Members and 1 Guest are viewing this topic.

Offline c4ooo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 252
  • Rating: +10/-1
  • The impossible chemical compound.
    • View Profile
Why does axe greyscale look so bad at very high speeds?
« on: April 18, 2015, 05:50:08 pm »
So this has been bugging me fore some time so I desised to ask about it. As I've mentioned in title, at very fast speeds greyscale looks like greyscale would look at very slow speeds. Can someone explain what couses this and how axe implements greyscale in the first place? Also why can't you just render the 1st and 2nd buffer in rapid succession, instead of doing this weird diagonal line thing axe does now?
-German Kuznetsov
The impossible chemical compound.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Why does axe greyscale look so bad at very high speeds?
« Reply #1 on: April 18, 2015, 05:56:20 pm »
To achieve better grayscale you have to have your DispGraphrr inside of an interrupt with just the correct speed.
Runer112 made a library which makes that very easy, called GrayLib, you can find it here: https://www.omnimaga.org/ti-z80-calculator-projects/%28axe-library%29-graylib-%28nearly%29-perfect-grayscale/

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline c4ooo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 252
  • Rating: +10/-1
  • The impossible chemical compound.
    • View Profile
Re: Why does axe greyscale look so bad at very high speeds?
« Reply #2 on: April 18, 2015, 06:07:09 pm »
Yes I know that, but I want to know why this is happening in the first place. I always thought that the faster the buffers are displayed, the "greyer" the greyscale is.
-German Kuznetsov
The impossible chemical compound.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Why does axe greyscale look so bad at very high speeds?
« Reply #3 on: April 18, 2015, 06:08:23 pm »
No, that is not the case, because the calculator screen has a certain refresh rate. The goal is to hit that refresh rate as good as possible, else you are either to fast or to slow, thus the gray because distorted.

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline c4ooo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 252
  • Rating: +10/-1
  • The impossible chemical compound.
    • View Profile
Re: Why does axe greyscale look so bad at very high speeds?
« Reply #4 on: April 18, 2015, 06:12:19 pm »
O well ok then. So pretty much it's just "screen tear"
-German Kuznetsov
The impossible chemical compound.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Why does axe greyscale look so bad at very high speeds?
« Reply #5 on: April 18, 2015, 06:17:02 pm »
I'm going to assume that by "high speed" you mean updating the screen with very little time between updates. In this case, it's possible that you're updating faster than the screen's refresh rate, which is about 60Hz. So, for example, if you're sending frames at 90Hz, you'll send 3 frames in the time that the display can only show 2. This likely means that one of those frames will be skipped (more realistically, parts of different frames get skipped, but the outcome is similar). Grayscale relies on having pixels on and off for the correct ratio of time, so the screen skipping some updates results in the ratio being wrong and pixels having the wrong shades.

I believe the "diagonal line thing" you're seeing is another artifact of the updates not being perfectly in sync with the screen's refresh rate and frames being mixed. You'd still have frames mixing if you just alternated sending complete buffers. But combining the buffers into a dithered image makes each individual frame appear much closer to the desired shades, to the degree that your eyes can't really tell when the refresh rate is fast enough. If you simply alternated buffers, a flashing effect would be much more apparently because your eyes can pick out large blocks of pixels alternating between black and white. And I think the screen has problems with it.

As Sorunome suggested, if you're looking for high-quality grayscale, I would definitely recommend trying GrayLib. I realize it can be a bit daunting to get into, but if you have any questions, just ask and I (or someone else) should be happy to answer.

Offline c4ooo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 252
  • Rating: +10/-1
  • The impossible chemical compound.
    • View Profile
Re: Why does axe greyscale look so bad at very high speeds?
« Reply #6 on: April 20, 2015, 06:50:59 am »
I have looked into greylib, and i actually have two questions/concerns about it  :)

EDIT: i have posted a reply on the greylib page, pls read.
« Last Edit: April 20, 2015, 07:14:38 am by c4ooo »
-German Kuznetsov
The impossible chemical compound.