Is there a way to have a xBR shader that works at far less intensity? Maybe 25% or lower? Would this be the right place to ask?
Iâm not sure what you mean by âintensityâ. Like, itâs too bright?
The degree to which it is attempts to smooth pixilation. Right now the aim is perfectly smooth edges. What if, however, a xbr shader was made that tried to smooth pixilation by a mere fraction of what it currently attempts? That way it could be simply one minor effect and paired with other shaders. The attempt right now is to use xbr to create a perfectly smooth image alone by itself. But what Iâd like to try is to have a far less intense xbr shader and to pair it with several others.
you could use the xbr versions with lower levels or xbr-hybrid which is a combination of xbr and reverse-aa. otherwise I donât think this is a trivial change according to the algorithm explanation by hyllian. xBR makes a binary decision whether a bunch of pixels are building an edge or not and if thatâs the case then it will be interpolated. there is no strength parameter, only a similarity threshold (see annex1 in the first post of this thread).
Okay, the two best PASSES around are Spookyfoxâs 4 pass mpadt and, of course, Hyllianâs xBR lvl3. Lv4 is awesome too (itâs the only think I use for gameboy games as it finally makes those games look right on HD and runs at an acceptable speed - not too much slowdown, drain on the retroarch).
Ideally, a faster running LVL4xBR that runs at acceptable speed for most everything else hopefully can happen someday (too slow on GENESIS games and most everything else).
But the holy grail for me right now would be too combine the LVL3 xBR passes with Spookyfoxâs mdapt 4 pass. I wouldnât know how to combine these (canât get them too work when I try to manually put them together). And even then they would probably run too slow together.
Anyone here interested in helping me out?
It seems like mostly any game without xBR and the anti-filtering pass is somehow lacking or deficient to my graphic loving perfectionist OCD eyes.
Hoping someone could throw something together with the skills to make it happen.
Hi people, just passing to say âHiâ and answer this question below.
Your request was already answered in this very thread. It was the same question made by Sp00kyFox in this post: viewtopic.php?p=8950#p8950
The solution is in this post: viewtopic.php?p=8955#p8955
Though it was answered for the mlv4 version, it works the same way for the LV3 version.
[quote=âHyllianâ] Hi people, just passing to say âHiâ and answer this question below.
Your request was already answered in this very thread. It was the same question made by Sp00kyFox in this post: viewtopic.php?p=8950#p8950
The solution is in this post: viewtopic.php?p=8955#p8955
Though it was answered for the mlv4 version, it works the same way for the LV3 version.[/quote]
Welcome back rockstar! Canât wait to see what you do next.
Anyhow, as for the above convo⌠uh, Iâm kinda of a dummie when it comes to stuff likes this. :-/ Tried to read those posts but as a layman/woman not sure practically how to put that together.
What I want to do, at least, is combine the lvl 3 xbr multi pass with the best of the mdapt (Iâm assuming the 4 pass).
If you donât mind, what steps do I have to do on my retroarch? I sorta understood the above but I donât know what I have to switch around and in what order, etc.
The way I understood this is: on passes 2 and 3 of lvl 3, donât specify the scale, just leave it open? Feels like Iâm missing something here.
Well, thanx for any help you can provide and welcome back!
P.S. Hoping that an optimized LVL4 multi pass is someday, somehow possible and in the works. The current one looks awesome but, as you know, runs slow on most things. Butâs itâs perfect! So close and so far⌠like most beloved things in life. Your filters are the best though. Sony should snatch you up. haha
Really!? You donât know how to open a txt file and use the replace option to change all occurrencies of âORIGâ by âPASS4â?
Just do what I said: Open the file âxbr-lv3-pass1.cgâ in a text editor and do what I said. Save it mount a shader combo of mdapt 4 passes and put xbr lv3 after it as passes 5 and 6. Just that!
hahaâŚYeah, like I said, Iâm a dummie. Didnât know you meant this. But I think I can handle this.
Your lvl 4 multi pass xBR is the Holy Grail of shaders at the moment. Runs slow. Looking forward to an optimized version of it someday. It is simply the best around!
Iâm having a look at hyllians warp filters right now and it seems there is an issue which I donât quite understand if itâs a bug or a hardware specific thing. the erosion.cg shader only gives me a black picture without any kind of error message. âŚ
edit: seems itâs a hardware related problem. I reduced the fragment shader of erosion.cg to a basic coreâŚ
/* FRAGMENT SHADER */
half4 main_fragment(in out_vertex VAR, uniform sampler2D decal : TEXUNIT0, uniform input IN) : COLOR
{
half3 E = tex2D(decal, VAR.t3.yw).rgb;
return half4(E, 1.0);
}
which still results in a black screen.
edit2: here is an ati fix of both shaders https://anonfiles.com/file/16adc28bf655 ⌠23bf2438e4
I have a feeling the problem lies in the swizzle part, because in bicubic-fast.cg I made some different approach and it works in my ati card. Look how I made in bicubic-fast:
tex,
float4(tex,tex) + float4( -dx, -dy, 0.0, -dy),
float4(tex,tex) + float4( dx, -dy, 2.0*dx, -dy),
And the swizzle in erosion shader:
OUT.texCoord = texCoord;
OUT.t2 = texCoord.xxxy + half4( -dx, 0, dx, -dy); // A B C
OUT.t3 = texCoord.xxxy + half4( -dx, 0, dx, 0); // D E F
When I get home Iâll try the bicubic approach on erosion to see if it solves the problem for ati cards without degrading performance. If yes, this solution should be done in other shaders that are atiphobic (xbr mlv4, for example).
Maybe doing this should fix the problem:
OUT.texCoord = texCoord;
OUT.t2 = float4(texCoord.x, texCoord.x, texCoord.x, texCoord.y) + half4( -dx, 0, dx, -dy); // A B C
OUT.t3 = float4(texCoord.x, texCoord.x, texCoord.x, texCoord.y) + half4( -dx, 0, dx, 0); // D E F
Just updated repo with a new shader: smart-blur.cg
It has a threshold (configurable) to apply blur only in low frequency color transitions. It helps to minimize posterization artifacts in xbr outputs. So, itâs a good second shader to any xbr shader.
Hereâs a screenshot comparison without and with smart-blur applied: http://screenshotcomparison.com/comparison/73035
The shader and preset are in the repo:
https://github.com/libretro/common-shad ⌠rt-blur.cg
https://github.com/libretro/common-shad ⌠t-blur.cgp
That really works some magic on those gradients! Good stuff, man
Yes, it does a very good job in some games. In others it isnât very good. I need to tweak the thresholds a bit more to find a sweet spot. And the shader needs some optimizations too.
I specially like that in some games the backgrounds seem to have some kind of depth of field effect! =D
xbr really benefits from it. still a fan from the hybrid variant =D anyway⌠donât know if it makes any difference in performance but wanted to mention
bool eq(float3 c1, float3 c2) {
float3 df = abs(c1 - c2);
return (df.r < threshold.r) && (df.g < threshold.g) && (df.b < threshold.b);
}
can be simplified to this
bool eq(float3 c1, float3 c2) {
return all(abs(c1 - c2) < threshold);
}
see: http://http.developer.nvidia.com/Cg/all.html http://http.developer.nvidia.com/Cg/any.html
the algorithm itself seems suprisingly simple. but I donât know why the 4 pixels outside of the 3x3-box around the center are involved. seems like it could be a problem for small details if the shader is used at lower scale factors.
Tks, Sp00kyFox,
Iâll optimize it soon.
The four pixels are necessary to broad the blur, otherwise the effect would be too tiny.
The hybrid uses another approach. Iâm thinking if itâs possible to relate both approaches some way.
okay, I guess what confused me is why those pixels arenât used in the equality check. consider the central pixel in a white 3x3 box which is adjacent to a black line/area. your equality condition is obviously true so the result color gets darkened despite the big color difference where the white pixel adjacent to the black border stays white. thatâs probably not intended.
Youâre right! Thatâs an inconsistency.
BTW, Iâve changed a bit the approach and itâs now two times faster. It should be used with LINEAR enabled (though I couldnât see any differency when using NEAREST. Weird!).
This is v2: http://pastebin.com/Punji1rP
Iâve made a shader that tries to unblend any shader combination. That is, for example, letâs say you upscale a game using Retroarch and a combination of shaders. And it results in something too blurred for your tastes. If you put unblend.cg after the last shader, the output is unblended and the final palette will be more or less, the original one.
It works surprisingly well in some shaders. For example, it can turns ddt.cg output in something similar to xBR:
ddt at 2x and unblend.cg as a second shader to upscale to any size using linear samples:
Even xBR can benefit from this. Using xBR at only 2x (for a fast usage), and using unblend.cg as a second shader, turns the output into something very similar to a much higher xbr (5x, for example).
xBR at 2x with unblend.cg as a second shader to upscale to any size using linear samples:
But, it doesnât work with shaders that changes too much the original source. For example, it doesnât work with crt shaders, because the scanlines arenât in the original source, so it canât be unblended. It works well with shaders that try to interpolate the source, like: bicubics, lanczos, ddt, bilinear, jinc2, advancedAA, etc.
The unblend.cg shader is very simple and only works as the last shader with linear enabled: http://pastebin.com/AHxyrUFN
EDIT: The ddt Iâve used in the first shots is an updated one. The current ddt in the repo doesnât work well with unblend.
EDIT2: The way unblend works is like a FAKE signed distance field (SDF) method. It treats the input as an SDF map and do some kind of alpha test, though it doesnât choose between two colors (black or white), it decides among a bunch of colors in the region of the low res input. Itâs a bit prone to errors, though. I think Iâll try a gaussian fitler to see how it can fake an SDF compared to ddt.
Can I get some help? I need to convert the newest version of the CG shaders of xbr multipass shader (mlv4) into GLSL.
Unfortunately, Iâm not good with scripting and coding and canât figure out how to use github to do this.
I using retroarch on PC but the problem Iâm facing is that I canât combine the 4 pass mdapt with this one. I saw the newest version of xbr has a change that may make this possible now.
If anyone could help me, I would appreciate it!