I may be losing my mind but I think you have more vertical glow going on than horizontal, also for the love of all that is holy please use black screens to show off glow.
I mean you did after I asked, but it honestly helps alot imho.
Hmm yeah I do see what you mean. I think the horizontal blur is being applied after the glow, which looks a bit weird.
Last one two for the night, last thing to dial in with this preset is the glow.
I’m not sure if this is the same preset, I have like 3 or 4 test versions going now and I’m tired.
EDIT: I got It working. This is really good. The colors, the mask representation, glow, etc. really good job man.
Glad you got it working and thanks for the kind words. Only thing I’m still working on is the glow, not totally sure how I feel about it. This can be disabled by setting glow strength to 0.000 within the shader file; the settings adjustment menu only displays to 0.00 so it could actually be as high as 0.009 and it will look like 0.00 in the settings menu.
Yeah those glows are really hard to dial in, wihtout breaking the whole image… it reminds me of opening pandora’s box
Was wondering if you could weigh in on this.
Maybe this is just a matter of adjusting the glow settings, but it seems like something is out of order.
Glow should be the very last thing that gets applied, after gaussian blur and after deconvergence. Otherwise you get really strange looking results where stuff spills outside of the glow halo.
It could be that glow is getting applied first, or it could be that glow and deconvergence and horizontal blur are all being applied at the same time to the unfiltered pixels. If it’s out of order or being done simultaneously, that would explain these results. Glow has to be applied to the image AFTER gaussian blur and deconvergence to get good results.
Maybe I’m way off with this assessment, hoping you might shed some light.
Personally I have deconvergence happening way earlier in the passes on my setup.
So those shots I did months ago with deconvergence have it as one of the first passes like within the first 2-4 or so, iirc
How did you do that? I’m guessing you just put glass.slang as the first pass?
Even if that works, the horizontal blur might still be happening before/simultaneously with the glow (I’m still just speculating on what’s causing the problem, though)
I’ll have to look on my github real quick (don’t feel like booting my PC), but I’m personally using name’s deconvergence pass, mainly because I don’t need all the extra stuff from glass, plus I don’t like how code needs to run to use the deconvergence. (Nothing wrong with glass, just my shader is heavy enough as is lmfao.)
EDIT: I’m running grade as the first pass, then I’m running the deconvergence pass as the second pass.
okay that makes sense, but if my assumptions are correct the horizontal blur from GDV will still interfere with the glow, so I’m not sure what to do about that.
@Syh if you get a chance, can you confirm that putting deconvergence before horizontal blur makes a difference? For this test, best to just leave out the glow. Just figured it’d be easier for you since you already have things set up.
NVM, @guest.r just answered my question!
GDV and the main shader in the chain don’t use the blurred image directly for all of the other processings, it still reads from the vanilla linearized buffer.
The blurred glow sampler is accessed relatively late and it helps to define bloom too.
Glow itself is practically added as the last thing:
color = color + glow*Bloom;
color = pow(color, vec3(1.0/gamma_out));
FragColor = vec4(color*corner(pos0), 1.0);
if we look at the three last lines of the shader. But there is a catch, this glow implementation is very fast, but helps itself with linear sampling and there are tradeoffs. The glow curve over a native pixel is linear and there might be a very explicit beginning of the effect. Low glow range also doesn’t produce a very nice effect. I’m currently playing a bit with a better implementation.
So basically the horizontal blur and glow are both being applied to the vanilla, unfiltered buffer?
Wouldn’t it be a lot more accurate and look better if you did
- Apply horizontal blur
- Apply deconvergence (optional, not included in GDV)
- Apply glow
1 and 2 might be done simultaneously to the vanilla buffer, not sure if it makes a difference/haven’t thought about it enough.
3 should be done to the resulting output from doing 1 and 2. Hope that makes sense as I’m not very good at technical explanations.
Would this incur a big performance hit?
Sampler used for glow is calculated after the vanilla buffer and from the vanilla buffer (linearized). The vanilla buffer still remains available (and untouched) as it should.
The calculation of glow with the horizontal and vertical pass is basically a separate thing. But you can’t use the blurred result for other purposes as glow itself IMO, it’s quite a mess.
Like the deconvergence pass should upgrade the linearize pass at best.
Other passes like deconvergence should/could read from the vanilla buffer and once they are implemented, they become available for the main shader through an alias.
You can read it from the main shader like this:
- add the line ( before alias DeconvergencePass must be declared in the preset)
layout(set = 0, binding = 6) uniform sampler2D DeconvergencePass;
2. You read the texels from this pass in the main shader:
float wtt = 1.0/(twl3+twl2+twl1+twr1+twr2+twr3);
float wt = 1.0/(wl2+wl1+wr1+wr2);
bool sharp = (s_sharp > 0.05);
vec3 l3 = COMPAT_TEXTURE(DeconvergencePass, pC4 -off2).xyz;
vec3 l2 = COMPAT_TEXTURE(DeconvergencePass, pC4 -offx).xyz;
vec3 l1 = COMPAT_TEXTURE(DeconvergencePass, pC4 ).xyz;
vec3 r1 = COMPAT_TEXTURE(DeconvergencePass, pC4 +offx).xyz;
vec3 r2 = COMPAT_TEXTURE(DeconvergencePass, pC4 +off2).xyz;
vec3 r3 = COMPAT_TEXTURE(DeconvergencePass, pC4 +offx+off2).xyz;
...
etc
If you do stuff at low res, the performance impact is quite negligible.
But you can’t use the blurred result for other purposes as glow itself IMO, it’s quite a mess.
So it just doesn’t look good if you apply the glow to the blurred result?
I’m actually not even sure which is correct/better looking (apply deconvergence to the blurred result vs. apply deconvergence and then blur). On a CRT the blur and the deconvergence were the same thing. It’s something to try, though.
I only half understand most of this so thanks for bearing with me. What I’m taking away from this is that I should probably just adjust the glow widths manually by looking closely at some screenshots.
Edit: I can already tell that I’m going to have to adjust both H glow radius and H glow grade. The border with the vertical glow is a lot sharper and I’m guessing that’s what it’s supposed to look like. This is going to be trickier than I thought
With those glows , whats helped me is the linearity test pattern on the 240p suit. With those circles you can easily see, if things get strange! For color checking the color bleed check is kinda nice.
Glow is the blurred result, regarding the horizontal (blur_horiz) and vertical (blur_vert) pass. But normally it’s added in small amounts afterwards.
The main shader should be setup regardless of it, to one’s liking IMO.
I’m actually not even sure which is correct/better looking (apply deconvergence to the blurred result vs. apply deconvergence and then blur). On a CRT the blur and the deconvergence were the same thing. It’s something to try, though.
Definitely the latter, first deconvergence and then blur. Glow will be painted a bit though.
I only half understand most of this so thanks for bearing with me. What I’m taking away from this is that I should probably just adjust the glow widths manually by looking closely at some screenshots.
With current implementation different glow sizes could require to tune the Glow Grade too. If you increase glow size by 1, then it’s gonna increase 1 native pixel in each direction. This is the tradeoff for implementing it at native resolution.
I think part of why glow effects tend to look a bit artificial is because the gaussian passes need to use relatively small kernels for performance reasons, which is where kawase blurs can come in handy (this is with the glow turned up really high for demonstration purposes):
compared with (normal):
Here’s a modified stock guest-dr-venom preset (that is, it runs from the ‘crt’ directory):
shaders = 13
shader0 = shaders/guest/lut/lut.slang
filter_linear0 = false
scale_type0 = source
scale0 = 1.0
textures = "SamplerLUT1;SamplerLUT2;SamplerLUT3"
SamplerLUT1 = shaders/guest/lut/sony_trinitron1.png
SamplerLUT1_linear = true
SamplerLUT2 = shaders/guest/lut/sony_trinitron2.png
SamplerLUT2_linear = true
SamplerLUT3 = shaders/guest/lut/other1.png
SamplerLUT3_linear = true
shader1 = shaders/guest/color-profiles.slang
filter_linear1 = true
scale_type1 = source
scale1 = 1.0
shader2 = shaders/guest/d65-d50.slang
filter_linear2 = true
scale_type2 = source
scale2 = 1.0
alias2 = WhitePointPass
shader3 = shaders/guest/afterglow.slang
filter_linear3 = true
scale_type3 = source
scale3 = 1.0
alias3 = AfterglowPass
shader4 = shaders/guest/avg-lum.slang
filter_linear4 = true
scale_type4 = source
scale4 = 1.0
mipmap_input4 = true
float_framebuffer4 = true
alias4 = AvgLumPass
shader5 = shaders/guest/linearize.slang
filter_linear5 = true
scale_type5 = source
scale5 = 1.0
float_framebuffer5 = true
alias5 = LinearizePass
shader6 = ../blurs/kawase/kawase0.slang
filter_linear6 = true
srgb_framebuffer6 = true
scale_type6 = source
wrap_mode6 = mirrored_repeat
shader7 = ../blurs/kawase/kawase1.slang
filter_linear7 = true
srgb_framebuffer7 = true
scale_type7 = source
wrap_mode7 = mirrored_repeat
shader8 = ../blurs/kawase/kawase1.slang
filter_linear8 = true
srgb_framebuffer8 = true
scale_type8 = source
wrap_mode8 = mirrored_repeat
shader9 = ../blurs/kawase/kawase2.slang
filter_linear9 = true
srgb_framebuffer9 = true
scale_type9 = source
wrap_mode9 = mirrored_repeat
shader10 = ../blurs/kawase/kawase3.slang
filter_linear10 = true
srgb_framebuffer10 = true
scale_type10 = source
wrap_mode10 = mirrored_repeat
alias10 = GlowPass
shader11 = shaders/guest/linearize_scanlines.slang
filter_linear11 = true
scale_type11 = source
scale11 = 1.0
float_framebuffer11 = true
shader12 = shaders/guest/crt-guest-dr-venom.slang
filter_linear12 = true
scale_type12 = viewport
scale_x12 = 1.0
scale_y12 = 1.0