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

[Request] Red/Cyan Anaglyph 3D shader? #103

Open TheBlackParrot opened 7 years ago

TheBlackParrot commented 7 years ago

I thought there would be one for sure considering shaders exist for Cardboard VR, would it be possible to create one for anaglyph 3D?

ghost commented 7 years ago

Are you wanting to convert side-by-side 3D to anaglyph? And if so, are you wanting to use this on videos/cores where the side-by-side image is packed into a single frame, or two different textures like with Mednafen VB?

TheBlackParrot commented 7 years ago

I'm guessing converting side-by-side 3D, packed into a single frame? It's something I'd use with those red/cyan glasses. like this

hizzlekizzle commented 7 years ago

Mednafen/Beetle-VB is the only core we have that produces actual 3D content, and it has red/cyan built-in as a core option, no shaders needed. We could definitely do a shader that does fake 3D and splits into red/cyan, but fake 3D kinda stinks :/

TheBlackParrot commented 7 years ago

ah. I assumed there was some actual 3D ability, dang.

ghost commented 7 years ago

@hizzlekizzle I would still be interested in doing generic frame packed 3D shaders e.g. for regular images and video. If we later have a core that outputs a packed frame then it could be useful for that too.

And for Mednafen VB it would be nice to be able to output other kinds of 3D besides red/cyan, just by using shaders. Is it possible to access both views independently?

hizzlekizzle commented 7 years ago

@bparker06 Mednafen has some other render methods that aren't exposed by the libretro-ization, like native side-by-side, that would let you access them independently. However, since VB is a black and white (er, red and black) system, the red and cyan images occupy totally separate color channels, so you can access them separately without interference, which is what I did for the anaglyph-to-side-by-side shader.