I wonder if anybody tried to use FXAA before doing display mapping BUT by still applying and reverting a curve ? š¤
Aka:
1 - Switch from HDR to SDR
2 - Apply FXAA
3 - Switch back from SDR to HDR
4 - Apply regular post-process stuff
I wonder if anybody tried to use FXAA before doing display mapping BUT by still applying and reverting a curve ? š¤
Aka:
1 - Switch from HDR to SDR
2 - Apply FXAA
3 - Switch back from SDR to HDR
4 - Apply regular post-process stuff
Just tried out the idea with a version of Reinhard from here: https://github.com/microsoft/DirectX-Graphics-Samples/blob/master/MiniEngine/Core/Shaders/ToneMappingUtility.hlsli#L58
... and it kinda work ?
I need to do more experiments, but that's promising !
Unfortunately the curve in there loose too much range, so specular reflections get really dimmed and the bloom loose in intensity.
So I tried out this instead: https://gpuopen.com/learn/optimized-reversible-tonemapper-for-resolve/
Wasn't enough either alone, so I applied the same trick did for my LUTs to compress further the range and it seems to be working.
The fog gradient doesn't seem to suffer (it was a good indication of the precision loss previously) and edges are still anti-aliased !
Alright, got it working at both end, depending on a switch. So I was able to compare.
On regular geometry edges, visually almost no differences.
BUT, doing FXAA as the last step end produce noticeable differences because it misses aliasing that has been exaggerated by some effects.
Example with my chromatic aberration effect:
Yesterday I tried once again to optimize my SSAO pass in compute, and still failed. A fragment shader still performs quite a lot better.
So today I decided to play again with my bloom and lens-flare to tinker with other ideas. Like anamorphic shapes.
Not necessarily a success, but I got interesting results just by playing with some buffers size or UVs:
Back on Ombre... and I decided to play again with lens-flares (I know 𤪠).
This time I wanted to try out the little radial projection trick from John Chapman article (https://john-chapman.github.io/2017/11/05/pseudo-lens-flare.html) to create fake streaks. It's a good start, but I will need to think about how to refine that effect. It looks nice already !
Been tweaking my lens-flare again for the past few days and now reaching a point where I want to try some kind of anamorphic bloom.
Right now I went with a hack where I modify one of the downsample texture when it is fed for the upsample pass. It is giving me a rough idea of what to expect, but it's not good enough yet (not sharp enough, and some flickering issue to manage still).
Will likely need to do a proper downsample/upsample process too.
I tweaked a bit more and properly integrated my bloom streak pass in the engine.
Combined with the regular bloom and the lens-flare this is all coming together well ! :)
I couldn't stop at two bloom passes, so I added a third one to fake atmospheric scattering.
So... how much humidity do you want in the air ? š
It is based on: https://github.com/OCASM/SSMS
(But I'm planning on improving some things.)
This morning I also quickly tried to add some fake halation effect (light bleeding into darker areas).
It's basically a highpass filter using the bloom downsamples and the current scene color texture, and then isolating the bright parts to make them bleed into the dark areas.
Currently it's an additive blend done with the HDR color, so it adds light. It low enough to no matter too much. Maybe I should use a lerp too to be more energy preserving ?
Woops, I had a Saturate() in there when setting up the highpass. Now I get why my halation edges where so sharp ! š
Also switched to a combination of mix/lerp for blending and it works as good as before. So no additional energy yeay !
I didn't notice it until today, because I decided to draw a texture straight to the screen for a temporary loading screen.
All fixed, so it looks like this now:
My current struggle.
I'm already doing the firefly attenuation based on Jimenez slides.
I'm trying to think about possible solutions:
- Clamping max brightness ?
- Reducing emissive intensity based on distance ?
- Doing some temporal stabilization (like TAA but only for bloom/fog downsample) ?
I'm open to suggestions.
@troy_s If I follow you well, that won't help I'm afraid.
Issue here is not that one pixel is so bright it blows but more like on the previous frame is wasn't as bright as the current one. So when the blur happens, the energy of the pixel spreads further creating a visibly more wide halo/tail. And because it wasn't during the previous frame it leads to flickering.
@troy_s I was thinking of something similar yeah, incorporating a temporal element.
Either an overall brightness value (maybe based on an average of all the pixels) from current frame and use that in next frame.
But this gets close to what Temporal Anti Aliasing do anyway. So I might do that directly.
@froyok I would think that a complete mean is going to cause some no fun. Using a lower spatial frequency mean might keep the thing congruent to the fields that arenāt modulating. And log would definitely help I am guessing.
Low frequency means you could keep a 10% buffer around perhaps, or smaller.
Would be neat to see!