libretro / common-shaders

Collection of commonly used Cg shaders. These shaders are usable by either HLSL and/or Cg runtime compilers. The cg2glsl script will translate most of these into GLSL shaders.
http://www.libretro.com
1.03k stars 250 forks source link

[Q] Any shader to darken only an area of the screen? #162

Closed eadmaster closed 3 years ago

eadmaster commented 3 years ago

I know the image-adjustment shader can do that on the whole screen, but i am looking for a way to darken only a portion of the screen, like shown in this shot: Super Aleste (Japan) (BS)

I'd like to use this with cores supporting widescreen hacks.

hizzlekizzle commented 3 years ago

You could use the imgborder shader with a semi-transparent png.

eadmaster commented 3 years ago

You could use the imgborder shader with a semi-transparent png.

thank you for the tip, but that shader seems to scale the image changing the aspect ratio, while i'd like to get an overlay-like effect.

HeuristicPerson commented 3 years ago

You can create your own overlay with a semi-transparent .png file. Actually, I think you can put 100% black opaque side bars and then play with the opacity of the overlay in the configuration file.

eadmaster commented 3 years ago

thank you, i was able to easily get the desired effect by modyifing the checker overlay. I guess this is faster to render than a shader, so i'll be using this...

overlays_mine.zip

hizzlekizzle commented 3 years ago

After thinking about this for a while, I did make a shader for it: image https://pastebin.com/EQhFkAir (slang format only currently)