Skip to content

Releases: rsn8887/Sharp-Bilinear-Shaders

Sharp-Bilinear Shaders for Retroarch v1.61

24 Aug 01:31
Compare
Choose a tag to compare

Sharp-Bilinear Shaders for Retroarch

This is a collection of shaders for sharp pixels without pixel wobble and minimal blurring in RetroArch/Libretro, based on TheMaister's work.

The following shaders are included:

  • "sharp-bilinear-2x-prescale"

This shader does a fixed 2x integer prescale resulting in a small amount of image blurring but no pixelwobble. This is a simple two-pass shader configuration. First, an integer 2x prescale is applied, followed by a bilinear scaling to fullscreen.

  • "sharp-bilinear-simple"

This shader does an automatic optimum integer prescale (2x, 3x, 4x etc.), depending on game and screen resolution. I recommend this shader since the autoscaling results in sharper images for some games than the fixed 2x prescale.

  • "sharp-bilinear-scanlines"

same as above, but with an overlay of black scanlines (half of each game pixel, vertically is a scanline)

All these shader configurations give sharp pixels with zero pixel wobble in all games.

Compared to the "video smoothing=ON" setting with no shaders, pixels are less blurry. Compared to the "video smoothing=OFF" setting with no shaders, the pixels do not change shape/wobble as they move across the screen.

Installation

To install this shader in RetroPie:

  • Copy the contents of the included "Copy_To_RetroPie" folder to /opt/retropie/emulators/retroarch/shader/
  • open the RetroPie-Setup menu and choose "Edit RetroPie/RetroArch Configurations"-> "configure basic libretro emulator options"-> "configure default options for all libretro emulators"
  • set "Video Shader Enable" to "True"
  • set "Video Shader File" to "sharp-bilinear-xxxxx.glslp," choosing xxxxx depending on your preference.

Example Images

shader "sharp-bilinear-simple.glslp" on:

shader off, smoothing on (too much blur):

shader off, smoothing off:

On first glance, the above looks sharp and good, but looking at a detail, we can see pixel wobble that happens if no shader is used. The pixels along the black diagonal should all be the same, square shape, but some of them appear rectangular:

Compare the above detail to the result with the shader on:

Now all pixels have the same shape, at the cost of a slight reduction in sharpness.

Performance

The calculations done by these shaders are trivial. Using any of these shaders with RetroPie on a Raspberry Pi 3 in 1080p full HD resolution, Street Fighter 3 Third Strike (libretro-fba) runs at a steady 60 fps.

Improvements compared to "retro/sharp-bilinear" from the Libretro repository

  • There's a small improvement that makes sharp-bilinear-simple work better with vertical games (shmups etc.). The autoscale is calculated separately for both the horizontal and vertical dimension, e.g. the integer prescale could be 4 for the horizontal, and 2 for the vertical. The original sharp-bilinear only used the vertical dimension to calculate the auto-prescale, and then used the same integer for both x and y.
  • The autoscaling factors are pre-calculated in the vertex shader, instead of re-calculating for every pixel.
  • The sharp-bilinear-2x-prescale filter is very simple compared to all the others. It is a simple shader config that applies two passes of the stock.glsl "Null shader," and therefore contains almost no calculations, and should be extremely fast.

Sharp-Bilinear Shaders for Retroarch v1.5

23 Aug 21:05
Compare
Choose a tag to compare

Sharp-Bilinear Shaders for Retroarch

This is a collection of shaders for sharp pixels without pixel wobble and minimal blurring in RetroArch/Libretro, based on TheMaister's work.

There are four shaders included.

  • "sharp-bilinear-2x-prescale"

This shader does a fixed 2x integer prescale resulting in a small amount of image blurring but no pixelwobble. This is a simple two-pass shader configuration. First, an integer 2x prescale is applied, followed by a bilinear scaling to fullscreen.

  • "sharp-bilinear-simple"

This shader does an automatic optimum integer prescale (2x, 3x, 4x etc.), depending on game and screen resolution. I recommend this shader since the autoscaling results in sharper images for some games than the fixed 2x prescale.

  • "sharp-bilinear-scanlines-thin"

same as above, but with an overlay of thin black scanlines (scanline on every even display line)

  • "sharp-bilinear-scanlines-thick"

same as above, but with an overlay of thick black scanlines (half of each game pixel, vertically is a scanline)

All these shader configurations give sharp pixels with zero pixel wobble in all games.

Compared to the "video smoothing=ON" setting with no shaders, pixels are less blurry. Compared to the "video smoothing=OFF" setting with no shaders, the pixels do not change shape/wobble as they move across the screen.

Installation

To install this shader in RetroPie:

  • Copy the contents of the included "Copy_To_RetroPie" folder to /opt/retropie/emulators/retroarch/shader/
  • open the RetroPie-Setup menu and choose "Edit RetroPie/RetroArch Configurations"-> "configure basic libretro emulator options"-> "configure default options for all libretro emulators"
  • set "Video Shader Enable" to "True"
  • set "Video Shader File" to "sharp-bilinear-xxxxx.glslp," choosing xxxxx depending on your preference.

Example Images

shader "sharp-bilinear-simple.glslp" on:

shader off, smoothing on (too much blur):

shader off, smoothing off:

On first glance, the above looks sharp and good, but looking at a detail, we can see pixel wobble that happens if no shader is used. The pixels along the black diagonal should all be the same, square shape, but some of them appear rectangular:

Compare the above detail to the result with the shader on:

Now all pixels have the same shape, at the cost of a slight reduction in sharpness.

Performance

The calculations done by these shaders are trivial. Using any of these shaders with RetroPie on a Raspberry Pi 3 in 1080p full HD resolution, Street Fighter 3 Third Strike (libretro-fba) runs at a steady 60 fps.

Improvements compared to "retro/sharp-bilinear" from the Libretro repository

  • There's a small improvement that makes sharp-bilinear-simple work better with vertical games (shmups etc.). The autoscale is calculated separately for both the horizontal and vertical dimension, e.g. the integer prescale could be 4 for the horizontal, and 2 for the vertical. The original sharp-bilinear only used the vertical dimension to calculate the auto-prescale, and then used the same integer for both x and y.
  • There was originally another improvement in sharp-bilinear-simple. The autoscaling factors were originally pre-calculated in the vertex shader, instead of re-calculating for every pixel. However, that only worked on Windows but not on the Raspberry Pi (driver not supporting pipelining between shaders?), so I reverted that feature.
  • The sharp-bilinear-2x-prescale filter is very simple compared to all the others. It is a simple shader config that applies two passes of the stock.glsl "Null shader," and therefore contains almost no calculations, and should be extremely fast.

Sharp-Bilinear Shaders for Retroarch v1.4

18 Aug 22:52
Compare
Choose a tag to compare

Sharp-Bilinear Shaders for Retroarch

This is a collection of shaders for sharp pixels without pixel wobble and minimal blurring in RetroArch/Libretro.

There are two shaders included.

  • "2x-prescale-sharp-bilinear"

This shader does a fixed 2x integer prescale resulting in a small amount of image blurring but no pixelwobble. This is a simple two-pass shader configuration. First, an integer 2x prescale is applied, followed by a bilinear scaling to fullscreen.

  • "sharp-bilinear-simple"

This shader does an automatic optimum integer prescale (2x, 3x, 4x etc.), depending on game and screen resolution. I recommend this shader since the autoscaling results in sharper images for some games than the fixed 2x prescale.

Both shader configurations give sharp pixels with zero pixel wobble in all games.

Compared to the "video smoothing=ON" setting with no shaders, pixels are less blurry. Compared to the "video smoothing=OFF" setting with no shaders, the pixels do not change shape/wobble as they move across the screen.

I tried TheMaister's autoscaling shader from the libretro repo, "retro/sharp-bilinear.glslp," but, for some reason, that shader did not work well with vertical games for me.

Installation

To install this shader in RetroPie:

  • Copy the contents of the included "Copy_To_RetroPie" folder to /opt/retropie/emulators/retroarch/shader/
  • open the RetroPie-Setup menu and choose "Edit RetroPie/RetroArch Configurations"-> "configure basic libretro emulator options"-> "configure default options for all libretro emulators"
  • set "Video Shader Enable" to "True"
  • set "Video Shader File" to "sharp-bilinear-simple.glslp," or "2x-prescale-sharp-bilinear.glslp" depending on your preference.

Example Images

shader "sharp-bilinear-simple.glslp" on:

shader off, smoothing on (too much blur):

shader off, smoothing off:

On first glance, the above looks sharp and good, but looking at a detail, we can see pixel wobble that happens if no shader is used. The pixels along the black diagonal should all be the same, square shape, but some of them appear rectangular:

Compare the above detail to the result with the shader on:

Now all pixels have the same shape, at the cost of a slight reduction in sharpness.

Changelog

1.4

  • fixed sharp-bilinear-simple, it only worked on Windows but not on Raspberry Pi

1.3

  • added sharp-bilinear-simple shader with autoscale

1.2

  • Initial release of 2x-prescale-sharp-bilinear

Sharp-Bilinear Shaders for Retroarch v1.3

18 Aug 20:03
Compare
Choose a tag to compare

Sharp-Bilinear Shaders for Retroarch

This is a collection of shaders for sharp pixels without pixel wobble and minimal blurring in RetroArch/Libretro.

There are two shaders included.

  • "2x-prescale-sharp-bilinear"

This shader does a fixed 2x integer prescale resulting in a small amount of image blurring but no pixelwobble. This is a simple two-pass shader configuration. First, an integer 2x prescale is applied, followed by a bilinear scaling to fullscreen.

  • "sharp-bilinear-simple"

This shader does an automatic optimum integer prescale (2x, 3x, 4x etc.), depending on game and screen resolution. I recommend this shader since the autoscaling results in sharper images for some games than the fixed 2x prescale.

Both shader configurations give sharp pixels with zero pixel wobble in all games.

Compared to the "video smoothing=ON" setting with no shaders, pixels are less blurry. Compared to the "video smoothing=OFF" setting with no shaders, the pixels do not change shape/wobble as they move across the screen.

I tried TheMaister's autoscaling shader from the libretro repo, "retro/sharp-bilinear.glslp," but, for some reason, that shader did not work well with vertical games for me.

Installation

To install this shader in RetroPie:

  • Copy the contents of the included "Copy_To_RetroPie" folder to /opt/retropie/emulators/retroarch/shader/
  • open the RetroPie-Setup menu and choose "Edit RetroPie/RetroArch Configurations"-> "configure basic libretro emulator options"-> "configure default options for all libretro emulators"
  • set "Video Shader Enable" to "True"
  • set "Video Shader File" to "sharp-bilinear-simple.glslp," or "2x-prescale-sharp-bilinear.glslp" depending on your preference.

Example Images

shader "sharp-bilinear-simple.glslp" on:

shader off, smoothing on (too much blur):

shader off, smoothing off:

On first glance, the above looks sharp and good, but looking at a detail, we can see pixel wobble that happens if no shader is used. The pixels along the black diagonal should all be the same, square shape, but some of them appear rectangular:

Compare the above detail to the result with the shader on:

Now all pixels have the same shape, at the cost of a slight reduction in sharpness.