Page 1 of 3

Checkerboard flickering shenanigans

Posted: Sat Jan 05, 2013 8:05 am
by Sik
This was discussed for a while not that long ago, so I wondered to see how it'd look when applied to the NES (at least in theory).

The idea behind the checkerboard pattern flickering is that there are two checkerboard patterns with opposite orientations and that they are alternated every frame. Since the pixels don't cover a large enough area, this blends to the eye much better than normal flickering, and if the colors are somewhat close it's pretty much indistinguishable from a single solid color (very useful for making smooth gradients without risking breaking the silhouette).

In theory, it should look like this:

Image

Problem is... the PPU completely breaks this by having every other line shifted by half a pixel. So if you try to apply this trick on the NES, what you get doesn't look anywhere as pleasant (though blurring caused by a low quality signal may sorta hide it):

Image

Ouch, that doesn't look like a checkerboard at all. Generally a better suggestion is to use vertical bars instead of a checkerboard pattern. Unsurprisingly, this actually looks better, though for the record, the outcome ends up being a checkerboard pattern in itself:

Image

And finally, for comparison, checkerboard pattern and vertical bars without any flickering:

Image

Image

There are other issues I'm not taking into account, like any noise introduced by RF or composite encoding. Leaving that for later, I have absolutely no idea how is the noise generated.

Re: Checkerboard flickering shenanigans

Posted: Sat Jan 05, 2013 8:23 am
by Bregalad
This again ?!

Re: Checkerboard flickering shenanigans

Posted: Sat Jan 05, 2013 10:33 am
by tepples
On the TVs that I use regularly (three CRT and one LCD), every other scanline in the composite signal output by the NTSC NES is not shifted by a fraction of a pixel. Are you on PAL, PAL/M, SCART, or something else? I can't take a guess because you haven't filled in the location field of your profile. There is a known problem with vertical edges between black ($0F) and darker colors ($0x/$1x) that can be seen especially in underground areas of SMB1, but that repeats on a 3-line pattern, not a 2-line pattern, and edges between black ($0F) and white ($20) are not affected at all.

Re: Checkerboard flickering shenanigans

Posted: Sat Jan 05, 2013 10:36 am
by mikejmoffitt
Between black and white a checkerboard pattern is fairly faithfully reproduced, with maybe some minimal rainbow pattern introduced. The system does not shift every scanline, that could be a defect of your display...

Against black many NTSC artifacts are harder to see as well; games like Super Mario Brothers 3 which feature black outlines over many objects do not suffer so badly as others which put different colors near each other (like the green flagpole against the blue backdrop in Super Mario Bros).

Re: Checkerboard flickering shenanigans

Posted: Sat Jan 05, 2013 1:03 pm
by koitsu
This sounds more like a display "issue" (please note I'm using quotes) than a 'PPU "issue"' or somesuch.

Moral of the story: what you draw/design on paper/in a graphics editor does not necessarily reflect how things will actually look on a display (whether it be CRT, LCD, or any other medium). Welcome to game design! :-)

Re: Checkerboard flickering shenanigans

Posted: Sat Jan 05, 2013 2:03 pm
by Sik
Well, screw that, guess I misunderstood how the anti dot crawl mechanism works =/ Disregard all this then.

Re: Checkerboard flickering shenanigans

Posted: Sat Jan 05, 2013 3:02 pm
by tepples
If you want to see what kind of artifacting you get when you use checkerboards on the NES, look at the title screen of Solstice or Dr. Mario. Or fire up Mario Paint and fill the screen with a dark blue checkerboard. Essentially you get a bunch of diagonal stripes from top left to bottom right, spaced 6 pixels apart, because of beating between the color subcarrier (1.5 pixel period) and the pixel pattern (2 pixel period in a checkerboard).

Re: Checkerboard flickering shenanigans

Posted: Sat Jan 05, 2013 4:40 pm
by Grapeshot
He was almost right, but only for the color part of the signal. In each scanline this is actually shifted from the previous line by 1/3 of the color frequency (4 cycles @ 21.7 mhz) or 2/3 of a pixel. So the pattern repeats every 3 lines. Then every other frame the phase is shifted by half a pixel as well. Flickering black and white checkerboards or two colors with the same hue would actually blend them, with anything else you would get stripes.

Re: Checkerboard flickering shenanigans

Posted: Sat Jan 05, 2013 4:56 pm
by lidnariq
ARGH.


NO.

The PIXELS are NOT SHIFTED. EVER.


The phase of the color subcarrier is what shifts.

Pure black and white content will have NO JITTER from scanline to scanline.

Re: Checkerboard flickering shenanigans

Posted: Sat Jan 05, 2013 6:01 pm
by tepples
lidnariq wrote:Pure black and white content will have NO JITTER from scanline to scanline.
Because if it did, then the menu of a multicart built with Action 53, such as the forthcoming Streemerz bundle, would be unreadable on my TV. Below is a photograph of my Vizio VX32L television displaying Action 53:

Image

Re: Checkerboard flickering shenanigans

Posted: Sat Jan 05, 2013 7:22 pm
by ccovell
Sik: on the Turbografx / PC-Engine, the VCE shifts pixels by half a pixel, spreading around artifacts... but this only applies to transitions between saturated colours. Pure greys do not move around or (in theory) have artifacts.

So, dithering with black and white should "work" correctly, not like in the example you made.

Re: Checkerboard flickering shenanigans

Posted: Sun Jan 06, 2013 7:33 am
by Sik
Just to make it clear: I had used white and black just to put two colors there, the theory was meant to be applied to any set of colors =P

Re: Checkerboard flickering shenanigans

Posted: Sun Jan 06, 2013 9:29 am
by mikejmoffitt
I was under the impression that all that is shifted is the color sub-carrier's position. This is to even out the artifacts over time.

Chris Covell's I want my RGB page describes this fairly decently on the screenshots page, and has this image to demonstrate:

Image

Re: Checkerboard flickering shenanigans

Posted: Sun Jan 06, 2013 1:06 pm
by Macbee
People who wants to avoid these rainbow patterns could also consider replacing checkerboard patterns with horizontal lines.
If Nestopia's NTSC filter isn't lying to me I come to the following conclusions:

1) Checkerboard patterns -
Pros: It's the ultimate flicker technique to make good looking images. Results are usually impressive.
Cons: Diagonal artifacts seems to be present all the time when using Composite cables, no matter how similar flickered colors are.

Demonstrative images (original graphics + NTSC/Composite display):
Image
Image


2) Horizontal lines patterns -
Pros: It's the only flicker technique that doesn't seem to create diagonal artifacts when using Composite cables.
Cons: End results doesn't look as good as checkerboard flickered images (shakiness is way more evident).

Demonstrative images (original graphics + NTSC/Composite display):
Image
Image

My tests were made using emulators only (I'd love to have a Powerpak but it's way too expensive for me).

Re: Checkerboard flickering shenanigans

Posted: Sun Jan 06, 2013 1:17 pm
by Dwedit
Oh god... Flickering again? We've been through this 100 times already. Flicker on LCD = good, flicker on anything else = bad.