Hi again,
Sorry for the delay. Super busy at work. I'm attaching a zip file with a shader called "yiqcolor" that just encodes an RGB color as YIQ using the standard matrix, applies tint/saturation adjustment, and then takes it back to RGB.
It has presets for the wikipedia YIQ->RGB formula as well as coefficients for the FCC standard, the Sony US matrix you posted, a different Sony YUV matrix, and a custom one that you can define in the shader. Probably most formulas you could find online are just a phase shift away from the standard, but that's fine.
The ZIP file contains a "bgfx" folder that you can merge with the bgfx folder in MAME 0.172. Then you can try out the effect with either the included "hlsl_yiq_tweak" or "yiqcolor" bgfx shader chains.
NOTE: It will stop working with 0173 since MooglyGuy has made a lot of changes to bgfx since 0172.
The shader chain, "hlsl_yiq_tweak", is just the standard hlsl shader chain with the color effect replaced with this and different defaults.
The shader chain, "yiqcolor", is just the color effects and nothing else.
I also included the shader source, as simple as it is.
-greg
> Curious if anyone has insight regarding palette output, as processed through the Sony > CXA2025AS US decoder matrix, whether it can be implemented as an option with all the > various shader and video filter possibilities currently available for MAME (?) > > Vice... > https://sourceforge.net/p/vice-emu/code/HEAD/tree/trunk/vice/src/video/render2x2ntsc.c > > ...and puNES... > https://github.com/punesemu/puNES/blob/master/src/video/filters/ntsc.c > > ...as well as Nestopia (Undead)... > https://github.com/rdanbrook/nestopia/blob/master/source/nes_ntsc/demo.c > ...has an option for it. > > It is also applied to (forks of) the Gens/Genesis emulator as well as a part of the > TwoMBit-Core featuring SMS emulation for OpenEmu. > > When selected as a palette option, the color hues are spectacular, nailing the way > respective console and computer systems appear when displayed on many highly utilized > and popular computer monitors and televisions. > > For those interested, the conversion formula (RGB --> YIQ) for this particular > decoder matrix is as follows: > R = Y + 1,630 * I + 0,317 * Q > G = Y - 0,378 * I - 0,466 * Q > B = Y - 1,089 * I + 1,677 * Q > Spec sheet/details are attached.
Edited by SoltanGris42 (04/19/16 09:08 AM)
|