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

MAME's RGB3 effect / visual effect #77

Open FeRcHuLeS opened 8 years ago

FeRcHuLeS commented 8 years ago

I was wondering if this effect could be ported as shader or filter, this is the ultimate crt shader for me that's because the effect emulates perfectly a crt monitor I've just checked my old crt tv and it has the same grid as the RGB3 effect and the old arcades had that grid too.

Every crt shader I tested have a visual error that happens when any game comes from bright to dark the horizontal lines stand out so some of those lines are thicker than others.

The dotmask shader is similar to the RGB3 effect but the dots stand out a lot, on the other hand the RGB3 effect is flawless I can hardly see the dots even if I'm near the screen, and the games emulation in modern TVs dont look pixelate at all, besides there are no visual errors such as the afore mentioned.

hizzlekizzle commented 8 years ago

You can do mame overlay effects through the overlay system, where we've ported over mame's "phosphor 3x" and "cools 4x" effects: https://github.com/libretro/common-overlays/tree/master/effects/scanlines

If you want to use a shader instead, the phosphorLUT shader does something similar to the MAME effects. Check out the phosphorLUT-shadowmask preset and then go into the parameters and change the phosphor scale X to 2.00 and the phosphor scale Y to 3.00. It looks like this: http://i.imgur.com/ol4t4ty.png

However, it sounds like the visual error you're describing is caused by non-integer scaling factors. If you enable integer scaling in your video options, you should get evenly-spaced scanlines.

FeRcHuLeS commented 8 years ago

hizzlekizzle wrote:

You can do mame overlay effects through the overlay system, where we've ported over mame's phosphor 3x" and "cools 4x" effects

phosphor 3x" and "cools 4x" overlays stand out too

hizzlekizzle wrote: If you want to use a shader instead, the phosphorLUT shader does something similar to the MAME effects

the phosphorLUT shader seems to me a bilinear filter

hizzlekizzle wrote: it sounds like the visual error you're describing is caused by non-integer scaling factors. If you enable integer scaling in your video options, you should get evenly-spaced scanlines.

I always play using interger scale on :)

I have to say all the scanlines vertical or horizontal filters on every emulator I tried even MAME's stand out to the sight sometimes they look like sea waves when the games goes from bright to dark or viceversa, that's not the case of RGB3 effect that it seems to based on hexagons not in squares grids, my avatar image is what is used for RGB3 effect by the way.

hizzlekizzle commented 8 years ago

I made your avatar into an overlay, named mame-rgb-3x: https://github.com/libretro/common-overlays/tree/master/effects/scanlines

Dunno if it looks how you're wanting but I think it's about as close as you're going to get in RetroArch.

FeRcHuLeS commented 8 years ago

Thanks hizzlekizzle for caring about and making an overlay, the thing is I made a mistake and give you the wrong pattern so I've just updated my avatar with the correct pattern with a black frame around it. By the way between yesterday and today I can differenciate between these 3 game screen improvements are they right or wrong? Filter: A tweak in the game screen that is done in some way by the console system itself Shader: A tweak in the game screen that is done by an additional outside process Overlay: An image over the game screen.

I would like the overlay you made to be a filter or shader someday thanks again =)

hizzlekizzle commented 8 years ago

Alright, I pushed up a new image based on your new avatar. This one looks better, I think.

Filters are post-processing that runs on the CPU and can include same-scale or up-scale effects. Shaders are post-processing that runs on the GPU and can include same-scale or up-scale effects. Overlays are images over the game screen. They do not affect the scaling of the image.

FeRcHuLeS commented 8 years ago

I find the new image better than before, the grid works better for brilliant colors than for dark colours where the grid is something like shiny dots however that's the way/limitations overlays work, doesn't it?. The question is how that hexagon based grid would work as a shader or filter?, thanks for the info people on the net weren't that clear. :)