Checkerboard flickering shenanigans

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Checkerboard flickering shenanigans
by on (#105571)
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
by on (#105573)
This again ?!
Re: Checkerboard flickering shenanigans
by on (#105583)
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
by on (#105584)
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
by on (#105597)
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
by on (#105600)
Well, screw that, guess I misunderstood how the anti dot crawl mechanism works =/ Disregard all this then.
Re: Checkerboard flickering shenanigans
by on (#105604)
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
by on (#105606)
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
by on (#105609)
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
by on (#105611)
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
by on (#105614)
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
by on (#105631)
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
by on (#105633)
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
by on (#105647)
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
by on (#105648)
Oh god... Flickering again? We've been through this 100 times already. Flicker on LCD = good, flicker on anything else = bad.
Re: Checkerboard flickering shenanigans
by on (#105649)
Someone should do a script that automatically deletes any thread or post with the word "flicker" in it.

PS : And no, I was not completely serious, but still...
Re: Checkerboard flickering shenanigans
by on (#105655)
You guys seriously need to chill out.
Re: Checkerboard flickering shenanigans
by on (#105659)
mikejmoffitt wrote:
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


I should add that I wrote right above it:
Quote:
Here's a theoretical example:


ie: it's not the NES specifically, but systems that vary their colourburst to get rid of artifacts.
Re: Checkerboard flickering shenanigans
by on (#105660)
Dwedit wrote:
Oh god... Flickering again? We've been through this 100 times already. Flicker on LCD = good, flicker on anything else = bad.

You mean the same LCDs that deinterlace every signal no matter what and completely destroy the flicker illusion? (and in fact that horizontal lines flickering idea would be completely broken on such a TV because it'll look like thick horizontal lines instead of alternating patterns)

In the end the only thing that seems to work properly is to avoid faking colors altogether and try to make graphics look good exclusively with solid colors, but that starts getting annoying when the amount of colors is so small.

Also any technique is going to look bad no matter what when the two colors in the mix are too different (like the green and black in those TMNT pics), even when there aren't any signal noise artifacts at all. It's just too noticeable to be usable.
Re: Checkerboard flickering shenanigans
by on (#105672)
Sik wrote:
In the end the only thing that seems to work properly is to avoid faking colors altogether and try to make graphics look good exclusively with solid colors, but that starts getting annoying when the amount of colors is so small.

You work with what you got, and what you've got is a console developed during the early-to-mid-80s and RTM mid-to-late 80s, using technology that was available at the time. I dunno what else there is to say; that's the reality of the situation. If you absolutely need/want more colours to accomplish the visual style you want, I would recommend going the SNES/SFC route. You'll be surprised how much easier it is to develop on the that platform anyway.
Re: Checkerboard flickering shenanigans
by on (#105678)
koitsu wrote:
Sik wrote:
In the end the only thing that seems to work properly is to avoid faking colors altogether and try to make graphics look good exclusively with solid colors, but that starts getting annoying when the amount of colors is so small.

You work with what you got, and what you've got is a console developed during the early-to-mid-80s and RTM mid-to-late 80s, using technology that was available at the time. I dunno what else there is to say; that's the reality of the situation. If you absolutely need/want more colours to accomplish the visual style you want, I would recommend going the SNES/SFC route. You'll be surprised how much easier it is to develop on the that platform anyway.

Why not take the next step and develop on PC instead? Now THAT'S when the developing really becomes easier. Point being, part of the charm is trying to push the envelope.

Personally I think there's a time and place for flickery type effects. I probably wouldn't use them in games (unless I can verify that it looks OK across the board), but I think it's fine to use them in demos.
Re: Checkerboard flickering shenanigans
by on (#105681)
Sik wrote:
Dwedit wrote:
Also any technique is going to look bad no matter what when the two colors in the mix are too different (like the green and black in those TMNT pics), even when there aren't any signal noise artifacts at all. It's just too noticeable to be usable.


These images are there only as a visual reference of different flickering techniques. I've never said they make good use of colors - because I know they don't. :)
TMNT was one of the few conversions I've made using both checkerboard and horizontal lines flickering - so I tought it could be interesting to show it here (despite color palettes).

But I'll repeat a sentence from my TMNT post:
Diagonal artifacts seems to be present all the time when using Composite cables, no matter how similar flickered colors are..
Samples of checkboarded patterns made of similar colors (+NTSC/Composite filter on Nestopia):
Image Image Image Image
The diagonal "rainbow patterns" are still there...
Re: Checkerboard flickering shenanigans
by on (#105691)
thefox wrote:
Why not take the next step and develop on PC instead? Now THAT'S when the developing really becomes easier. ...

...until you have to deal with graphics APIs and underlying SDKs with crappy documentation, with a Web filled with completely wrong information. There's a reason I stopped doing anything with graphics/video circa 1997. Kudos to anyone who toughs it out, but god the situation is abysmal today.
Re: Checkerboard flickering shenanigans
by on (#105697)
Macbee wrote:
The diagonal "rainbow patterns" are still there...

Not anywhere even remotely as noticeable though. Could be even considered passable, the Blanka pic seems to be the only one where it's sorta easy to notice (the Sega logo happens to go along the diagonals ^_^') and even then the impact is pretty light.
Re: Checkerboard flickering shenanigans
by on (#105701)
Sik wrote:
Macbee wrote:
The diagonal "rainbow patterns" are still there...

Not anywhere even remotely as noticeable though. Could be even considered passable, the Blanka pic seems to be the only one where it's sorta easy to notice (the Sega logo happens to go along the diagonals ^_^') and even then the impact is pretty light.


Yep, I agree with you. These patterns are discrete and "forgivable" to me as well.
I just tried to illustrate they'll always be there if checkerboard is used.

Don't get me wrong: I'm a big fan of flickering - no matter how it's done. :)
Thanks (again!) to thefox for his amazing "Nes Image Converter" tool. I'm still addicted to this software 1+ year after I've downloaded it.
Re: Checkerboard flickering shenanigans
by on (#105826)
On SMS and MD you get straight vertical rainbowing not diagonal. There is no colorburst shifting happening of any kind on them.
Re: Checkerboard flickering shenanigans
by on (#105828)
TmEE wrote:
On SMS and MD you get straight vertical rainbowing not diagonal. There is no colorburst shifting happening of any kind on them.

Advantageously straight vertical lines don't look fuzzy?scratchy as a result, though (Mario flagpole I am looking at you!)
Re: Checkerboard flickering shenanigans
by on (#105832)
Macbee wrote:
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.

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).


What happens when you use a horizontally-stretched checkerboard pattern?

For instance, two columns for every row, or three columns for every row:

Code:
xx  xx
  xx  xx
xx  xx


xxx   xxx
   xxx   xxx
xxx   xxx


This seems like it'd be a good compromise between the two methods.
Re: Checkerboard flickering shenanigans
by on (#105837)
Videomation uses a stretched-checkerboard pattern for six of the ten color choices.
Re: Checkerboard flickering shenanigans
by on (#105885)
Drag wrote:
Macbee wrote:
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.

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).


What happens when you use a horizontally-stretched checkerboard pattern?

For instance, two columns for every row, or three columns for every row:

Code:
xx  xx
  xx  xx
xx  xx


xxx   xxx
   xxx   xxx
xxx   xxx


This seems like it'd be a good compromise between the two methods.


Unfortunately, this ends up looking less like blended colors and more like a stretched checkerboard at that point.
Re: Checkerboard flickering shenanigans
by on (#106100)
Drag wrote:
Macbee wrote:
What happens when you use a horizontally-stretched checkerboard pattern?

For instance, two columns for every row, or three columns for every row:

Code:
xx  xx
  xx  xx
xx  xx


xxx   xxx
   xxx   xxx
xxx   xxx


This seems like it'd be a good compromise between the two methods.


Nice suggestion Drag! I've tried it and the results are good.
There are noticeable artifacts on background - but it's hard to see them on Iceman's body (where similar colors are flickered). Sretched checkerboard patterns looks better (than regular checkerboard ones) when using composite cables IMO.

Image

I'm attaching 3 Iceman roms here - each one made with a different flickering technique (lines, checkerboard and stretched checkerboard).