Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
anti-aliasing [2021/08/17 06:30] – minor formatting, preparing next section for psx atarianti-aliasing [2023/02/05 04:09] (current) – render to texture is no longer a thing atari
Line 7: Line 7:
 ===== What is anti-aliasing? ===== ===== What is anti-aliasing? =====
  
-In essence, a way to mitigate aliasing caused by computer generated graphics, typically apparent when showing a lower resolution image on a large display. You may be familiar with this being called "jaggies" or "the staircase effect", where the square edges of pixels become very obvious. In the image below, the top is the original image as it appears at its native resolution, the left is that image simply enlarged (notice the staircasing effect on the diagonals) while the right one has been 'anti-aliased' by a filter.+In essence, a way to mitigate aliasing caused by computer generated graphics, typically apparent when showing a lower resolution image on a large display. You may be familiar with this being called "jaggies" or "the staircase effect", where the square edges of pixels become very obvious. In the image below, the top is the original image as it appears at its native resolution, the left is that image simply enlarged (notice the staircasing effect on the diagonals) while the right one has been 'anti-aliased' by an upscaler.
  
 {{antialiasing:2xsai_example.png?direct|Pixel-art example of X2 SAI upscaling, a special form of anti-aliasing.}} {{antialiasing:2xsai_example.png?direct|Pixel-art example of X2 SAI upscaling, a special form of anti-aliasing.}}
  
-<sup>Image illustrated by Wikimedia user [[https://commons.wikimedia.org/wiki/User:LucasVB|LucasVB]]. Licensed under [[https://creativecommons.org/licenses/by-sa/3.0/deed.en|Creative Commons]].</sup>+<wrap lo>Image illustrated by Wikimedia user [[https://commons.wikimedia.org/wiki/User:LucasVB|LucasVB]]. Licensed under [[https://creativecommons.org/licenses/by-sa/3.0/deed.en|Creative Commons]].</wrap>
  
 ==== That looks garbage, why would I want this? ==== ==== That looks garbage, why would I want this? ====
Line 40: Line 40:
 {{antialiasing:pixel-art_scaling_comparison.png?direct&523|Upscaler comparisons.}} {{antialiasing:pixel-art_scaling_comparison.png?direct&523|Upscaler comparisons.}}
  
-<sup>A comparison of common upscaling techniques. Author: [[https://commons.wikimedia.org/wiki/User:Drummyfish|Drummyfish]]. Licensed under [[https://creativecommons.org/publicdomain/zero/1.0/deed.en|Creative Commons]].</sup>+<wrap lo>A comparison of common upscaling techniques. Author: [[https://commons.wikimedia.org/wiki/User:Drummyfish|Drummyfish]]. Licensed under [[https://creativecommons.org/publicdomain/zero/1.0/deed.en|Creative Commons]].</wrap>
  
 ===== Mip-mapping ===== ===== Mip-mapping =====
Line 48: Line 48:
 {{antialiasing:mipmap_aliasing_comparison.png?direct|Bathroom floor simulator 2021.png}} {{antialiasing:mipmap_aliasing_comparison.png?direct|Bathroom floor simulator 2021.png}}
  
-<sup>The Moire effect is visible on the further tiles without mip-mapping, whethers with mip-mapping they appear blurry instead. Taken from Rick’s blog http://tower22.blogspot.com/2011_10_01_archive</sup>+<wrap lo>The Moire effect is visible on the further tiles without mip-mapping, whethers with mip-mapping they appear blurry instead. Taken from Rick’s blog http://tower22.blogspot.com/2011_10_01_archive</wrap>
  
 Some 3D consoles however, such as the N64, instead used this for alternative purposes such as texture transitions (the Peach painting in Super Mario 64) or texture animation. This usually came at a significant performance cost due to not actually replacing textures with lower memory ones but instead just switching it with an identically sized one (cutting the usable texture memory in half), so most games opted not to utilize it. Some 3D consoles however, such as the N64, instead used this for alternative purposes such as texture transitions (the Peach painting in Super Mario 64) or texture animation. This usually came at a significant performance cost due to not actually replacing textures with lower memory ones but instead just switching it with an identically sized one (cutting the usable texture memory in half), so most games opted not to utilize it.
Line 62: Line 62:
 {{antialiasing:anisotropic_filtering_en.png?direct&768|The repeating ground texture stays sharp with anisotropic filtering on.}} {{antialiasing:anisotropic_filtering_en.png?direct&768|The repeating ground texture stays sharp with anisotropic filtering on.}}
  
-<sup>The repeating tiles in the background appear much sharper with anisotropic filtering enabled. Author: THOMAS, derivative of [[https://commons.wikimedia.org/wiki/User:Lampak|Lampak]]'s work. Licensed under [[https://creativecommons.org/licenses/by-sa/3.0/deed.en|Creative Commons]].</sup>+<wrap lo>The repeating tiles in the background appear much sharper with anisotropic filtering enabled. Author: THOMAS, derivative of [[https://commons.wikimedia.org/wiki/User:Lampak|Lampak]]'s work. Licensed under [[https://creativecommons.org/licenses/by-sa/3.0/deed.en|Creative Commons]].</wrap>
  
-And the best part is that this is pretty CPU/GPU inexpensive, as it's just leveraging the already existing mip-mapping functionality. If you're in a situation where you //can// activate anisotropic filtering, there is a high chance you can go all the way up to x16 without penalty. If you're on really weak hardware like an [[https://wiki.batocera.org/devices|SBC]], you can get away with just doing say x4 anisotropic filtering and still get most of its benefits.+And the best part is that this is pretty CPU/GPU inexpensive, as it's just leveraging the already existing mip-mapping functionality. If you're in a situation where you //can// activate anisotropic filtering, there is a high chance you can go all the way up to x16 without penalty. If you're on really weak hardware like an [[choose_a_single_board_computer|SBC]], you can get away with just doing say x4 anisotropic filtering and still get most of its benefits.
  
 ===== Multi-Sample Anti-Aliasing ===== ===== Multi-Sample Anti-Aliasing =====
Line 72: Line 72:
 {{antialiasing:msaa.png?direct&640|Also super effective at making telephone wires not vanish in and out of existence.}} {{antialiasing:msaa.png?direct&640|Also super effective at making telephone wires not vanish in and out of existence.}}
  
-<sup>The edges of geometry appears much more natural with MSAA enabled. Cropped from Nvidia's comparison page (link no longer available).</sup>+<wrap lo>The edges of geometry appears much more natural with MSAA enabled. Cropped from Nvidia's comparison page (link no longer available).</wrap>
  
 For enhancing the appearence of 3D objects, MSAA is on the cheaper side as it only tries to do it for the edges of objects, but in practice can still cut your framerate in half even at x2. Use this only if you know your system has plenty of overhead to spare. Due to the way it's implemented, MSAA may introduce visual artifacts (visible seams on textures with transparency, layer ordering disabling MSAA on certain objects but not others, etc.) that would otherwise not be present. Alternatively you could use a shader to blur the output of the entire image, negating the benefit/need of MSAA. If you have plenty of overhead, then you could use SSAA instead (explained in the next section). For enhancing the appearence of 3D objects, MSAA is on the cheaper side as it only tries to do it for the edges of objects, but in practice can still cut your framerate in half even at x2. Use this only if you know your system has plenty of overhead to spare. Due to the way it's implemented, MSAA may introduce visual artifacts (visible seams on textures with transparency, layer ordering disabling MSAA on certain objects but not others, etc.) that would otherwise not be present. Alternatively you could use a shader to blur the output of the entire image, negating the benefit/need of MSAA. If you have plenty of overhead, then you could use SSAA instead (explained in the next section).
Line 82: Line 82:
 {{antialiasing:ssaa.png?direct&256|This isn't actually Minecraft, just a render.}} {{antialiasing:ssaa.png?direct&256|This isn't actually Minecraft, just a render.}}
  
-<sup>SSAA can make even Minecraft-esque blocks appear more natural! Author: Gsliepen. Licensed under [[https://creativecommons.org/licenses/by-sa/3.0/deed.en|Creative Commons]].</sup>+<wrap lo>SSAA can make even Minecraft-esque blocks appear more natural! Author: Gsliepen. Licensed under [[https://creativecommons.org/licenses/by-sa/3.0/deed.en|Creative Commons]].</wrap>
  
 Comes at a severe performance cost; SSAA can only realistically be utilized by x86 based computer running powerful graphics cards. Since its end results are very similar to MSAA, you may want to use that instead. Comes at a severe performance cost; SSAA can only realistically be utilized by x86 based computer running powerful graphics cards. Since its end results are very similar to MSAA, you may want to use that instead.
Line 94: Line 94:
   * xBR enhancement {{antialiasing:thps2-xbr-texture-enhancement.png?direct&600}}   * xBR enhancement {{antialiasing:thps2-xbr-texture-enhancement.png?direct&600}}
  
-===== How does this apply to Batocera? =====+===== Texture Replacement ===== 
 + 
 +Also known as "texture packs", this takes texture enhancement to its logical extreme. What if the textures are just completely redrawn by hand? 
 + 
 +Obviously this is not an automated solution so it depends on someone having done the work itself, but it results in objectively the highest texture quality output feasible on the emulator of all the other techniques. 
 + 
 +It can also offer the opportunity to restyle the game in an entirely different art style. 
 + 
 +Since such features are dependent on the emulator supporting them, they are usually only noted in [[:systems|their respective wiki pages]]. 
 + 
 +===== How does all this apply to Batocera? =====
  
 It's a fairly complicated subject, so I'll make ludicrous use of comparison images here for illustration. Keep in mind that you don't need to actually go and configure all of this yourself, Batocera's default "Auto" setting will do a perfectly fine job. It's a fairly complicated subject, so I'll make ludicrous use of comparison images here for illustration. Keep in mind that you don't need to actually go and configure all of this yourself, Batocera's default "Auto" setting will do a perfectly fine job.
Line 100: Line 110:
 ==== Shaders ==== ==== Shaders ====
  
-Shader sets are pre-configured shaders that can imitate the look of a classic CRT television, giving a more authentic look for older systems as they would have typically appeared on televisions used at the time. Refer to [[https://wiki.batocera.org/emulationstation:shaders_set|shader sets]] for more comparisons and how to make shader sets yourself.+Shader sets are pre-configured shaders that can imitate the look of a classic CRT television, giving a more authentic look for older systems as they would have typically appeared on televisions used at the time. Refer to [[:emulationstation:shaders_set|shader sets]] for more comparisons and how to make shader sets yourself. Click on the following images for the proper effect!
  
-For 3D systems 5th gen and above (PSX, N64, etc.) shaders aren't as beneficial, though some may still prefer them to retain the true authentic experience. 2D games, although uncommon on these systems, still reap the same benefits as they did from 4th gen and before.+{{:antialiasing:earthworm-jim-reference.png?direct|Take note where the arrows show.}} {{:antialiasing:earthworm-jim-final-output.png?direct|Absolutely magical.}} 
 + 
 +For 3D systems 5th gen and above (PSX, N64, etc.) shaders aren't as beneficial, though some may still prefer them to retain the true authentic experience. 2D games, although uncommon on these systems, still reap the same benefits as they did from 4th gen and before. If you'd like to see a bunch of example comparisons, [[https://twitter.com/crtpixels?lang=en|this Twitter account]] is worth a visit.
  
 ==== 3D Enhancements ==== ==== 3D Enhancements ====
Line 130: Line 142:
 {{antialiasing:n64deblur.jpg?direct&920}} {{antialiasing:n64deblur-small.jpg?nolink}} {{antialiasing:n64deblur.jpg?direct&920}} {{antialiasing:n64deblur-small.jpg?nolink}}
  
-<sup>Taken from [[https://www.retrorgb.com/n64blur.html|RetroRGB's blogpost]].</sup>+<wrap lo>Taken from [[https://www.retrorgb.com/n64blur.html|RetroRGB's blogpost]].</wrap>
  
-This filter is typically not emulated. You can simulate an approximation of the filter by leaving the "Smooth games" option turned on, but a better one would be using a weak gaussian blur such as one provide by RetroArch shaders.+This filter is typically not emulated. You can simulate an approximation of the filter by leaving the "Smooth games" option turned on, but a better one would be using a weak gaussian blur such as one provided by RetroArch shaders.
  
 === PSX 3D Enhancement === === PSX 3D Enhancement ===
Line 138: Line 150:
 The original [[systems:psx|PlayStation]] had no form of anti-aliasing whatsoever, 2D or 3D. Geometry and textures were always rendered to their nearest point. This was slightly masked by the blurry video output of the PSX. Thus, all forms of anti-aliasing can be considered an enhancement. The original [[systems:psx|PlayStation]] had no form of anti-aliasing whatsoever, 2D or 3D. Geometry and textures were always rendered to their nearest point. This was slightly masked by the blurry video output of the PSX. Thus, all forms of anti-aliasing can be considered an enhancement.
  
-^ 3D Enhancement ^ Preview ^ Notes ^ +^ 3D Enhancement ^ Preview (click to enlarge) ^ Notes ^ 
-| Native rendering resolution | {{antialiasing:thps2-native.png?direct&720}} | Take note of all the "jaggies". This is how it would have appeared on the original hardware, if the PSX could produce a crystal clear video signal. | +| Native rendering resolution | {{antialiasing:thps2-native.png?direct&900}} | Take note of all the "jaggies". This is how it would have appeared on the original hardware, if the PSX could produce a crystal clear video signal. | 
-| Native resolution + 8x MSAA | {{antialiasing:thps2-8x-msaa.png?direct&720}} | Note how only some edges of objects, such as the plane wing and the overhead light, have been smoothened. The warehouse divider that's flush with the glass still has jagged edges. | +| Native resolution + 8x MSAA | {{antialiasing:thps2-8x-msaa.png?direct&900}} | Note how only some edges of objects, such as the plane wing and the overhead light, have been smoothened. The warehouse divider that's flush with the glass still has jagged edges. | 
-| Native resolution + 8x SSAA | {{antialiasing:thps2-8x-ssaa.png?direct&720}} | Now all objects and textures have been properly smoothed out. Keep in mind this is still at native rendering resolution output (~288p), at higher rendering resolutions the effect isn't as blurry. | +| Native resolution + 8x SSAA | {{antialiasing:thps2-8x-ssaa.png?direct&900}} | Now all objects and textures have been properly smoothed out. Keep in mind this is still at native rendering resolution output (~288p), at higher rendering resolutions the effect isn't as blurry. | 
-| Increased rendering resolution | {{antialiasing:thps2-no-texture-enhancement.png?direct&720}} | The most neutral enhancement. Notice how the low resolution textures have become more apparent. | +| Increased rendering resolution | {{antialiasing:thps2-no-texture-enhancement.png?direct&900}} | The most neutral enhancement. Notice how the low resolution textures have become more apparent. | 
-| Increased resolution + JINC2 texture enhancement | {{antialiasing:thps2-jinc2-texture-enhancement.png?direct&720}} | Makes it look like a N64 game! Blasphemy! Note how it doesn't handle transparent textures like the plane's shadow too well. | +| Increased resolution + JINC2 texture enhancement | {{antialiasing:thps2-jinc2-texture-enhancement.png?direct&900}} | Makes it look like a N64 game! Blasphemy! Note how it doesn't handle transparent textures like the plane's shadow too well. | 
-| Increased resolution + xBR texture enhancement | {{antialiasing:thps2-xbr-texture-enhancement.png?direct&720}} | Makes the ground look like a watercolor painting. This enhancement works better for simplistic art styles. |+| Increased resolution + xBR texture enhancement | {{antialiasing:thps2-xbr-texture-enhancement.png?direct&900}} | Makes the ground look like a watercolor painting. This enhancement works better for simplistic art styles. | 
 + 
 +=== Precision Geometry Transform Pipeline === 
 + 
 +The PlayStation is renown for its... //unique// way of inaccurately rendering 3D geometry, especially when close to the camera. This is actually due to it using the more primitive form of 3D graphics generation which used integer coordinate models instead of the floating point accurate models, but that's outside the scope of this page. [[https://www.copetti.org/writings/consoles/playstation/|Here's a cool article about it.]] 
 + 
 +Some emulators in Batocera have the Precision Geometry Transform Pipeline (PGXP) which can attempt to correct this; it's still fairly unstable though and can cause games to unexpectedly crash, so use with caution. The only way to activate this is through duckstation-emu-config (F1 on systems menu, Applications) under Settings > Enhancement Settings > PGXP > Geometry Correction or through RetroArch's Quick Menu for the mednafen and swanstation cores (Hotkey+{{:wiki:south.png?nolink&20|South button (B SNES)}}) (correct as of v31). PGXP corrects physical geometry, PGXP Perspective Correct Texturing corrects the textures on geometry. The benefits of this are best seen in motion: https://www.youtube.com/watch?v=EYCpd_1lPUc 
 + 
 +Here is a comparison of the perspective texture correction: 
 + 
 +  * Without PGXP texture correction: {{antialiasing:pgxp_texture_off.jpg?direct&720|Tomb Raider without PGXP.}} 
 +  * With PGXP texture correction: {{antialiasing:pgxp_texture_on.jpg?direct&720|Tomb Raider with PGXP.}} 
 + 
 +<wrap lo>Shamelessly stolen from the [[https://docs.libretro.com/library/beetle_psx_hw/#core-options|libretro docs]].</wrap> 
 + 
 +Using texture correction requires PGXP to already be activated. 
 + 
 +=== Dreamcast Render to Texture Enhancement === 
 + 
 +<WRAP center round important> 
 +This setting has been removed from Flycast since **v36**! It's now automatically adjusted with rendering resolution. 
 +</WRAP> 
 + 
 +The Dreamcast's screen buffer is infrequently utilized by games to produce certain graphics in-game, typically during the pause screen. By default, this buffer will be at native resolution, irrespective of the current rendering resolution.
  
-=== Geometry Perspective Correction ===+^ 3D Enhancement ^ Preview (click to enlarge) ^ Notes ^ 
 +| Native rendering resolution | {{antialiasing:crazy-taxi-native.png?direct&720}} | As the Dreamcast would have rendered it originally. | 
 +| Increased rendering resolution | {{antialiasing:crazy-taxi-upscaled.png?direct&720}} | The most neutral enhancement. Notice how the edges of the taxi has become less jagged. | 
 +| Increased resolution, native render to texture resolution | {{antialiasing:crazy-taxi-native-render-to-texture.png?direct&720}} | Despite the video output being higher resolution, the screen buffer is still at a low native resolution. | 
 +| Increased resolution, 4x render to texture resolution | {{antialiasing:crazy-taxi-4x-render-to-texture.png?direct&720}} | Now both the rendering resolution and the screen buffer are higher resolution, resulting in a clearer pause screen in Crazy Taxi. |
  
-FIXME 
  • anti-aliasing.1629181853.txt.gz
  • Last modified: 5 years ago
  • by atari