Difference between revisions of "Dithering"

From Emulation General Wiki
Jump to navigation Jump to search
(Further reading)
m (Reverted edits by 71.95.119.28 (talk) to last revision by Bot)
(Tag: Rollback)
(4 intermediate revisions by 4 users not shown)
Line 7: Line 7:
 
[[File:Policenauts_PC98.png|250px|right|thumb|Unblended dithering in Policenauts for the PC98]]
 
[[File:Policenauts_PC98.png|250px|right|thumb|Unblended dithering in Policenauts for the PC98]]
  
[[Genesis]] relies heavily on dithering. The waterfalls in Sonic the Hedgehog are a classic example.  A few [[SNES]] games use it as well (eg. Metal Warriors). Certain PS1 games, such as Silent Hill make heavy use of dithering. In that game it is used for shading. Many other PS1 games have a checkerboard.
+
[[Sega Genesis emulators|Sega Genesis]] relies heavily on dithering. The waterfalls in Sonic the Hedgehog are a classic example.  A few [[Super Nintendo emulators|SNES]] games use it as well (eg. Metal Warriors). Certain PS1 games, such as Silent Hill make heavy use of dithering. In that game, it is used for shading. Many other PS1 games have a checkerboard.
  
Dithering is frequently used for transparency effects in systems that cannot properly do them. [[Sega Saturn]] for one. The Saturn port of Castlevania: Symphony of the Night uses dithering for dialogue boxes, whereas the original PlayStation version has proper transparent boxes.
+
Dithering is frequently used for transparency effects in systems that cannot properly do them. [[Sega Saturn emulators|Sega Saturn]] for one. The Saturn port of Castlevania: Symphony of the Night uses dithering for dialogue boxes, whereas the original PlayStation version has proper transparent boxes.
  
 
Many older computer games used dithering, though unlike with console games, it was not expected for the dithering to be blended into solid colors or proper transparency due to the sharper output of PC monitors. Of particular note are games for Japanese computers such as the PC-88/98, which often featured heavy use of dithering.
 
Many older computer games used dithering, though unlike with console games, it was not expected for the dithering to be blended into solid colors or proper transparency due to the sharper output of PC monitors. Of particular note are games for Japanese computers such as the PC-88/98, which often featured heavy use of dithering.
  
 
==Emulation==
 
==Emulation==
The intended effects of dithering is often lost in emulation due to PCs typically using VGA or HDMI signals. The dots or lines appear as they actually are with no blurring. Options:
+
The intended effects of dithering are often lost in emulation due to PCs typically using VGA or HDMI signals. The dots or lines appear as they actually are with no blurring. Options:
 
*Accept the unblended dithering
 
*Accept the unblended dithering
 
*Remove the dithering entirely.
 
*Remove the dithering entirely.
Line 27: Line 27:
 
*'''gdapt'''<ref>https://github.com/libretro/common-shaders/tree/master/dithering/shaders/gdapt</ref> is a simpler, more aggressive variant of mdapt intended to handle dithering encountered in Genesis/Mega Drive games
 
*'''gdapt'''<ref>https://github.com/libretro/common-shaders/tree/master/dithering/shaders/gdapt</ref> is a simpler, more aggressive variant of mdapt intended to handle dithering encountered in Genesis/Mega Drive games
 
*'''cbod'''<ref>https://github.com/libretro/common-shaders/tree/master/dithering/shaders/cbod-v1</ref> or '''Conditional Blending of Dither''' is another implementation of selective dither blending. It appears to have a bit more blur than other algorithms.
 
*'''cbod'''<ref>https://github.com/libretro/common-shaders/tree/master/dithering/shaders/cbod-v1</ref> or '''Conditional Blending of Dither''' is another implementation of selective dither blending. It appears to have a bit more blur than other algorithms.
*'''snes-hires-blend'''<ref>https://github.com/libretro/common-shaders/blob/master/crt/shaders/snes-hires-blend.cg</ref> blends the vertical line patterns that appear at 512px width only, while doing nothing for 256px graphics. It is intended to be used in a few SNES games like Kirby's Dream Land 3 where it used vertical line patterns in psuedo-hires mode to achieve translucency on CRTs. This shader has zero false positives when used as intended.
+
*'''snes-hires-blend'''<ref>https://github.com/libretro/common-shaders/blob/master/crt/shaders/snes-hires-blend.cg</ref> blends the vertical line patterns that appear at 512px width only, while doing nothing for 256px graphics. It is intended to be used in a few SNES games like Kirby's Dream Land 3 where it used vertical line patterns in a pseudo-hires mode to achieve translucency on CRTs. This shader has zero false positives when used as intended.
  
 
==Further reading==
 
==Further reading==

Revision as of 15:32, 17 March 2019

Left showing native resolution and unblended dithering. Right showing HD and no dithering.

Dithering is a technique to increase the amount of color and shading that can be done on a system. The effect is achieved by using lines or dots which are then blurred by the low quality NTSC signals (composite or RF) that the system uses. Modern computers use higher quality analog VGA (RGBHV) or digital HDMI, DVI, or DisplayPort signals, which means that the dithering ends up being sharp and unblurred.

Use in games

Sega Genesis Game Lion King showing unblended dithering
Unblended dithering in Policenauts for the PC98

Sega Genesis relies heavily on dithering. The waterfalls in Sonic the Hedgehog are a classic example.  A few SNES games use it as well (eg. Metal Warriors). Certain PS1 games, such as Silent Hill make heavy use of dithering. In that game, it is used for shading. Many other PS1 games have a checkerboard.

Dithering is frequently used for transparency effects in systems that cannot properly do them. Sega Saturn for one. The Saturn port of Castlevania: Symphony of the Night uses dithering for dialogue boxes, whereas the original PlayStation version has proper transparent boxes.

Many older computer games used dithering, though unlike with console games, it was not expected for the dithering to be blended into solid colors or proper transparency due to the sharper output of PC monitors. Of particular note are games for Japanese computers such as the PC-88/98, which often featured heavy use of dithering.

Emulation

The intended effects of dithering are often lost in emulation due to PCs typically using VGA or HDMI signals. The dots or lines appear as they actually are with no blurring. Options:

  • Accept the unblended dithering
  • Remove the dithering entirely.
    • Requires assets to actually be of a higher color palette. Enabling 32-bit colors in ps1 emulators achieves this, as dithering is done by hardware during 16-bit conversion to output.
  • Use a blurring or NTSC composite shader which reproduces the same amount of blur as the original composite signal that was output by original hardware.
  • Use a dithering shader designed to just selectively blend the dithering but does not blend the rest of the image.

Shaders

There are several different shaders that selectively blend dithering patterns, to varying degrees of success. Certain patterns can be difficult to selectively blend without false positives.

  • mdapt[1] selectively blends checkerboard and vertical line patterns, and has settings for tweaking the algorithm.
  • gdapt[2] is a simpler, more aggressive variant of mdapt intended to handle dithering encountered in Genesis/Mega Drive games
  • cbod[3] or Conditional Blending of Dither is another implementation of selective dither blending. It appears to have a bit more blur than other algorithms.
  • snes-hires-blend[4] blends the vertical line patterns that appear at 512px width only, while doing nothing for 256px graphics. It is intended to be used in a few SNES games like Kirby's Dream Land 3 where it used vertical line patterns in a pseudo-hires mode to achieve translucency on CRTs. This shader has zero false positives when used as intended.

Further reading

Official mdapt thread

References