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.05k stars 250 forks source link

CRT Shader Rotation for Vertical MAME Games #50

Closed Awakened0 closed 9 years ago

Awakened0 commented 9 years ago

Current CRT shaders don't rotate for vertically orientated games in MAME. Would it be possible to add auto detection to them so if they see a game running at something like 240x320, the scanlines and shadowmask are rotated? Or maybe a manual vertical parameter?

I've seen some discussion about a version of Lottes shader modified for vertical games in MAME here: http://www.mameworld.info/ubbthreads/showthreaded.php?Cat=&Number=331810&page=0&view=expanded&sb=5&o=&vc=1

hizzlekizzle commented 9 years ago

Rather than changing the shaders, it would be better for the core to handle it. FBA does it properly. Not sure why MAME doesn't.

For making crt-lottes vertical, this one should work, though it doesn't look particularly awesome that way: http://pastie.org/10219401

The thing to remember when making it vertical is that his shadow mask doesn't play nicely with being rotated because it depends on the geometry of LCD pixels, so simply rotating the whole shader won't work without modification. I had to rotate the other stuff while leaving the dotmask intact.

andres-asm commented 9 years ago

maybe it's because MAME uses a huge framebuffer underneath, it's running a framebuffer 1600x1200 IIRC

Awakened0 commented 9 years ago

Yeah, that vertical version doesn't look any better than the normal one with a rotated game in MAME. Seems like it really is something that needs to be changed in the core. Though you'd still need a modified version of Lottes to make that one look best.

I'll close this and open an issue on the core's page.