Can you share the source for it too please? Thank you!
Sure, it’s very similar. Try this one:
// 50% horizontal blend; quick and dirty gamma correction
// by hunterk
// license: public domain
#if defined(VERTEX)
#if __VERSION__ >= 130
#define COMPAT_VARYING out
#define COMPAT_ATTRIBUTE in
#define COMPAT_TEXTURE texture
#else
#define COMPAT_VARYING varying
#define COMPAT_ATTRIBUTE attribute
#define COMPAT_TEXTURE texture2D
#endif
#ifdef GL_ES
#define COMPAT_PRECISION mediump
#else
#define COMPAT_PRECISION
#endif
COMPAT_ATTRIBUTE vec4 VertexCoord;
COMPAT_ATTRIBUTE vec4 TexCoord;
COMPAT_VARYING vec4 TEX0;
uniform mat4 MVPMatrix;
uniform COMPAT_PRECISION int FrameDirection;
uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
// compatibility #defines
#define vTexCoord TEX0.xy
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutSize vec4(OutputSize, 1.0 / OutputSize)
void main()
{
gl_Position = MVPMatrix * VertexCoord;
TEX0.xy = TexCoord.xy;
TEX0.zw = TexCoord.xy - vec2(SourceSize.z, 0.);
}
#elif defined(FRAGMENT)
#ifdef GL_ES
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#define COMPAT_PRECISION mediump
#else
#define COMPAT_PRECISION
#endif
#if __VERSION__ >= 130
#define COMPAT_VARYING in
#define COMPAT_TEXTURE texture
out COMPAT_PRECISION vec4 FragColor;
#else
#define COMPAT_VARYING varying
#define FragColor gl_FragColor
#define COMPAT_TEXTURE texture2D
#endif
uniform COMPAT_PRECISION int FrameDirection;
uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform sampler2D Texture;
COMPAT_VARYING vec4 TEX0;
// compatibility #defines
#define Source Texture
#define vTexCoord TEX0.xy
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutSize vec4(OutputSize, 1.0 / OutputSize)
void main()
{
vec3 curr_px = COMPAT_TEXTURE(Source, TEX0.xy).rgb;
vec3 prev_px = COMPAT_TEXTURE(Source, TEX0.zw).rgb;
curr_px *= curr_px;
prev_px *= prev_px;
FragColor = vec4(sqrt((curr_px + prev_px) / 2.), 1.0);
}
#endif
Thanks! I don’t mind. That might be up to @hunterk and the rest of LibRetro team I suppose. It shouldn’t be too difficult as its just a few presets which attempt to improve on what’s already there, especially in terms of minimizing distracting artifacts, brightness improvements and most importantly finding the highest resolution where dither blending would still work.
I’d be honoured if they could be included.
You mean the ones in the “Video options”?
These don’t work. If i use GenesisPlusGX, i get a squished image that only takes half of my screen. If i use BlastEM, it just won’t do anything.
GPGX has it built-in and modified to work with the Genesis/MD video output.
That’s strange, they’ve always worked fine for me.
I was referring to the filters that are included in the Core Options–>Video.
It’s the ones made for SNES in the Video Filters Folder that used to do what you described on certain cores.
I haven’t used the ones in the Video Options in a while because I now use my custom Video Filter presets which work perfectly.
You can give them a try and see if they work for you. They’re in my CyberLab Mega Bezel Death To Pixels Shader Preset Pack.
Ok i downloaded the new filters in the archive and these work.
The core options do work but the composite option creates some banding artifacts on Sonic’waterfalls when you scroll. These new video filter options though work nicely.
Thanks
I second this. Just tried it with some random cores and they work and look marvelous.
Is it just the filt presets that are changed? or do the libs need to have changes in the source?
Just the filt presets. blargg_ntsc_snes.dll remains the same.
You mean the ones in the “Video options”?
These don’t work. If i use GenesisPlusGX, i get a squished image that only takes half of my screen.
The core options do work but the composite option creates some banding artifacts on Sonic’waterfalls when you scroll.
That’s why I suggested @Cyber Genesis .filt presets to be bundled with Retroarch. Others have side effects (GPGX Comsposite), dont eliminate dithering (GPGX S-Video and RGB) or squish image (SNES presets from filters/video folder)
If it’s just the presets, yeah, that should be pretty straightforward to include. If it needed modifications to the lib, that would take some more due diligence.
I think we can move on this pretty quickly. If anyone wants to put in a PR for it, go for it. Otherwise, I’ll get one going later on.
I think we can move on this pretty quickly. If anyone wants to put in a PR for it, go for it. Otherwise, I’ll get one going later on.
You can go right ahead. How can I go about doing a PR though? Maybe this can be one of my first pull requests and additions to my so far unused GitHub Repo?
You fork the original libretro repo to your own account, make your changes locally, make a commit and push it up to your repo, then go to the ‘pull requests’ tab and make one against the parent repo (it chooses it automatically by default). Once submitted, we can check it out and review it and if everything looks good, we merge it into the main codebase.
Thanks a lot. I’ll try this over the next couple days. If I don’t get through, you can go ahead and add it.
One thing I noticed is that the built-in Genesis Composite Filter creates a rainbow effect but mine don’t, but they do de-dither and they do it cleanly. I use them in conjunction with presets with sharpness cranked to the highest point before unwanted artifacts.
I have those in my pack but users can also crank sharpness up in presets of their own and de-dithering will still work.
Update:
@hunterk Just created my first PR!
Do you need any additional information?
The two genesis filters in your pack both do de-dithering. Even the s-video one. I’m glad it does because the picture is cleaner than the composite one but also merges the dithering.
The built in s-video filter looks good but doesn’t completely merge the dithering, just slightly.
I imagine on the real machine the built in s-video filter is more accurate? Did s-video merge dithering as such?
Again, even if it’s not accurate, it would be better to rename it as “composite HQ” or something instead of fixing it. This is the best de-dithering filter i used so far.
I imagine on the real machine the built in s-video filter is more accurate? Did s-video merge dithering as such?
I really don’t know. As a child I didn’t even notice things like the transparency on the waterfalls and I’ve never seen a Genesis with S-Video out.
Again, even if it’s not accurate, it would be better to rename it as “composite HQ” or something instead of fixing it.
I like the name as it is though. The terms Composite, S-Video and RGB are all relative here and my system is that consoles have their own characteristics and modules so that in the context of Genesis, which supposedly had degraded outputs compared to other systems (at least composite) this would be S-Video.
In the filter this is simply a resolution range with many possibilities in between the default Composite, S-Video and RGB settings.
So let’s pretend it’s S-Video for now. If users want “accurate” naming they can use the built-in filters.
I think 2 “Composite” presets for one system might be a bit confusing and messy.
Instead, my naming system is that Composite is lowest resolution, S-Video is higher than Composite resolution and RGB is higher than S-Video resolution.
I prefer things to be a bit more fun, casual, “dummy” friendly, commercial, marketing style than technical, nerdy and super precise so that even a caveman or baby can understand.
Users can also rename it internally to whatever is more meaningful to them.
I also wouldn’t want the naming to be out of sync with my internal development and naming.
This is the best de-dithering filter i used so far.
I’m really glad you like it. You have to thank @Juandiegous who’s work showed me that it was possible to edit the filter presets.
Hola a todos. He comprobado que la opción de filtro de video del core GenesisPlusGX Blargg no realiza bien la función de dithering en su preset “video compuesto”. Al desplazarse el scroll de forma lateral las transparencias en azul alternan un cuadro con saturación y otro menos saturado. Por otro lado las otras opciones “S-Video” y “RGB” dejan entrever las bandas verticales del dithering porque son demasiado nítidos. [internal blargg ok] [internal blargg wrong] Este parpadeo me resulta compl…
You mentioned renaming as an alternative to fixing. I offer these presets simply as a way for others to enjoy what I experience, so there isn’t anything to fix because S-Video can de-dither better than the built-in. This is just the CyberLab experience at this point in time that more users can now experience for themselves without having to download my preset pack. That’s also why they’re called “CyberLab_Special-Edition”.
My unique twist on the way I do things is what makes them special.
The real machine doesn’t have s-video without a mod. You can watch a video here, s-video makes it way cleaner.
@hunterk Is it possible to add 50% vertical blend to this shader? I always wanted simple and fast blur shader. I may as well use this one for that purpose.
// 50% horizontal blend; quick and dirty gamma correction
// by hunterk
// license: public domain
#if defined(VERTEX)
#if __VERSION__ >= 130
#define COMPAT_VARYING out
#define COMPAT_ATTRIBUTE in
#define COMPAT_TEXTURE texture
#else
#define COMPAT_VARYING varying
#define COMPAT_ATTRIBUTE attribute
#define COMPAT_TEXTURE texture2D
#endif
#ifdef GL_ES
#define COMPAT_PRECISION mediump
#else
#define COMPAT_PRECISION
#endif
COMPAT_ATTRIBUTE vec4 VertexCoord;
COMPAT_ATTRIBUTE vec4 TexCoord;
COMPAT_VARYING vec4 TEX0;
uniform mat4 MVPMatrix;
uniform COMPAT_PRECISION int FrameDirection;
uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
// compatibility #defines
#define vTexCoord TEX0.xy
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutSize vec4(OutputSize, 1.0 / OutputSize)
void main()
{
gl_Position = MVPMatrix * VertexCoord;
TEX0.xy = TexCoord.xy;
TEX0.zw = TexCoord.xy - vec2(SourceSize.z, 0.);
}
#elif defined(FRAGMENT)
#ifdef GL_ES
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#define COMPAT_PRECISION mediump
#else
#define COMPAT_PRECISION
#endif
#if __VERSION__ >= 130
#define COMPAT_VARYING in
#define COMPAT_TEXTURE texture
out COMPAT_PRECISION vec4 FragColor;
#else
#define COMPAT_VARYING varying
#define FragColor gl_FragColor
#define COMPAT_TEXTURE texture2D
#endif
uniform COMPAT_PRECISION int FrameDirection;
uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform sampler2D Texture;
COMPAT_VARYING vec4 TEX0;
// compatibility #defines
#define Source Texture
#define vTexCoord TEX0.xy
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutSize vec4(OutputSize, 1.0 / OutputSize)
void main()
{
vec3 curr_px = COMPAT_TEXTURE(Source, TEX0.xy).rgb;
vec3 prev_px = COMPAT_TEXTURE(Source, TEX0.zw).rgb;
curr_px *= curr_px;
prev_px *= prev_px;
FragColor = vec4(sqrt((curr_px + prev_px) / 2.), 1.0);
}
#endif
Sure, that’s possible, but I think you’re better off using the 3x3 blur from the ‘blurs’ directory.
3x3 is not available in GLSL. Also tried .slang version on pc and it doesnt blend genesis dithering unlike the one you converted.