Proposal for anti-shimmer technique when scrolling

A place for your artistic side. Discuss techniques and tools for pixel art on the NES, GBC, or similar platforms.

Moderator: Moderators

Post Reply
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Proposal for anti-shimmer technique when scrolling

Post by FrankenGraphics »

While looking at the level screens in this thread, i began to wonder about the circumstances for the dreaded "shimmer" effect that can happen to moving graphical objects with certain dither patterns.

Assuming the scrolling goes left and right, how about a pattern table* animation where the dither tiles change from original to a horizontally mirrored clone (or 1px adjusted, depending on how you see it) for each 1px increment of the scrolling. So even/odd positions correspond to A and B in the image below.

*or nametable, if the layout was simple enough to permit it.
anti-shimmer.png
anti-shimmer.png (816 Bytes) Viewed 5036 times
Same should work (if it works, initially) in tiles with mixed dither and background content (like the mountains in said thread) - by adjusting the dither 1px, but not the mountain contour.

What do you think? Would this help reduce or eliminate the shimmer?

(edit: removed duplette inline placement - i should never post using the phone)
Last edited by FrankenGraphics on Sun Jan 29, 2017 1:46 am, edited 1 time in total.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Proposal for anti-shimmer technique when scrolling

Post by lidnariq »

I have this suspicion that dithering between noticeably different brightnesses will always shimmer, because of NTSC.

For any given pixel of color C at any given fixed location on screen, regardless of the scroll value, there are three possible encodings from the 2C02.

At a specific (X,Y) on an NTSC screen it will only ever use exactly two of those three encodings, selecting based on (X-Y)%3 and whether whether this field is missing its pixel or not.

In order to prevent the shimmering, we'd need to maintain a constant average brightness within a pixel, while simultaneously maintaining the chroma angle within that pixel. The NES doesn't really give you that much rope. (The SNES does, however...)


Given that you seem to be suggesting "change the tile to keep the same pixel X,Y lit" ... yeah, that does sound like should help? But it could make for a weird moiré sensation.
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Proposal for anti-shimmer technique when scrolling

Post by rainwarrior »

I made a test ROM a little while ago to demonstrate the "3s" pattern of the NES NTSC colour artifacts:
https://forums.nesdev.com/viewtopic.php?f=2&t=15080

The simplest way is just to scroll 3 pixels at a time, or some multiple of that. It's kind of hard to work in 3s with 8x8 / 16x16 tile restrictions though. Scrolling by 2 is also fine if your patterns are in 2s, like the ones in your example (without using the technique you propsed). Shimmering tends to be most noticeable when scrolling is slower, though, so maybe neither of these cases is very helpful.

Dithering vertically but not horizontally (i.e. horizontal stripes) can also work pretty well.

I think your technique would reduce shimmer on the dither tiles, but it would still show strong diagonal artifacts in the 3s pattern. I'm curious how it would "feel" too to have some of the dither stationary while stuff moves around it, so I hope you try it out.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Proposal for anti-shimmer technique when scrolling

Post by dougeff »

Maybe if you changed the BG tileset as you scrolled (MMC3 style) so that the pattern never moves on the actual TV...

IE, if you scroll 1 pixel to the right, the tileset will load a pattern shifted by 1 pixel.
nesdoug.com -- blog/tutorial on programming for the NES
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Proposal for anti-shimmer technique when scrolling

Post by lidnariq »

dougeff wrote:Maybe if you changed the BG tileset as you scrolled (MMC3 style) so that the pattern never moves on the actual TV...

IE, if you scroll 1 pixel to the right, the tileset will load a pattern shifted by 1 pixel.
That's exactly what they suggested.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Proposal for anti-shimmer technique when scrolling

Post by tokumaru »

One problem is that regular dither patterns don't look good on the NES to begin with (scrolling or no scrolling), so most good artists will avoid those in the first place.
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: Proposal for anti-shimmer technique when scrolling

Post by FrankenGraphics »

rainwarrior wrote: I'm curious how it would "feel" too to have some of the dither stationary while stuff moves around it, so I hope you try it out.
I'm wondering this too, so it's a nice project that fits on my learning-to-code roadmap. My guess is that this would be best applied to distant objects (as a sort of a poor version of parallax techniques with limited use). But i'm even more curious to see how it feels when applied to, say, a structure that's supposed to be close behind the player object.
tokumaru wrote:One problem is that regular dither patterns don't look good on the NES to begin with.
I'm generally agreeing with this sentiment. I think dithering on the NES is best used to either make things look grimey, indistinct, soft, fuzzy, or to provoke colour artifacts to make the screen seem to have more colours than permitted, but it's an effect that's sensitive to circumstance. I guess this case goes in the 'for the sake of knowing' department, probably with a slight chance of seeing some practical use.
Post Reply