It is currently Wed Nov 22, 2017 9:02 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sat Jan 28, 2017 6:20 pm 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 1017
Location: Gothenburg, Sweden
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.

Attachment:
anti-shimmer.png
anti-shimmer.png [ 816 Bytes | Viewed 1191 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)

_________________
http://www.frankengraphics.com - personal NES blog


Last edited by FrankenGraphics on Sun Jan 29, 2017 1:46 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sat Jan 28, 2017 9:11 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6448
Location: UK (temporarily)
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.


Top
 Profile  
 
PostPosted: Sat Jan 28, 2017 9:28 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5829
Location: Canada
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.


Top
 Profile  
 
PostPosted: Sat Jan 28, 2017 11:11 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1832
Location: DIGDUG
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


Top
 Profile  
 
PostPosted: Sat Jan 28, 2017 11:25 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6448
Location: UK (temporarily)
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.


Top
 Profile  
 
PostPosted: Sun Jan 29, 2017 6:04 am 
Online
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10118
Location: Rio de Janeiro - Brazil
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.


Top
 Profile  
 
PostPosted: Sun Jan 29, 2017 6:51 am 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 1017
Location: Gothenburg, Sweden
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.

_________________
http://www.frankengraphics.com - personal NES blog


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group