Welcome, Guest.
Username: Password: Remember me

TOPIC: I might have an idea about temporal anti-alising

I might have an idea about temporal anti-alising 4 months 2 weeks ago #1

Hey there,

Before I explain what I want and and why I want it, let me tell you what I have been working on for a relatively long time:
GTA just got me go to a doctor because of it's severe pixel flickering and shimmering. Appereantly I focus on them a little too much. I have been looking for a solution since then and with ReShade I did solve the problem partially.

First I improve the colors with Levels, Vibrance and Clarity.
Then apply FXAA and Lumasharpen 3 times, but seperate them with motion blur.
So, basically what I do is;
1) save the previous frame. (motion blur1)
2) create the new one
3) apply color improvement and first layer of AA and sharpen
4) merge it with the previous frame (motion blur1)
5) save that frame (motion blur2)
6) apply new AA and sharpen
7) merge it with the just saved frame (motion blur2)
8) apply final layer of AA ad Sharpen
9) Apply deband and enjoy.
I'll upload a video soon on youtube so you can see the positive results about reducing aliasing and flickering.

However, Motion Blur shader is not the answer here. So I thought of something new. I have zero knowledge of coding so I can not make it myself but someone here who knows how to code a shader may understand my logic and convert it into a shader maybe.

What I want is; I know that ReShade can remember the previous frame. Imagine a shader that compares a pixel's current and previous values as color or as luminescence (or both). For example, let's assume choosing the luminescence option and set a clamp value of 50 (between 0 and 255). This means that the difference of that individual pixel's luminescence between the previous and the current frame can not be bigger than 50, if so; just clamp it to 50 (or merge it with it's previous value, including it's color; just like motion blur). If, it's lower than 50, just let it be.

Remember the trees in Assassin's Creed 4: Black Flag? There are gaps between the leaves smaller than one pixel but displayed either a full sized pixel or not displayed at all (due to the nature of rasterization) when moving around. The gaps are blue and very bright at color as they represent a bright sky, the leaves and the branches are relatively darker colors. When we move the camera, the branches and leaves will not trigger our shader's clamp limit as they are similar at luminescence, but when the pixels wants to display bright blue, it will not directly jump to bright blue, it will ease into transition with it, instead. The next frame, if it's bright blue again, only then it will be fully displayed.

What we do here is to eliminate the strong shimmering impact of a one-pixel-sized color which is displayed for only 1 or 2 frames and causes abnormal amount of brightness changing or flickering/shimmering. It will act like a selective motion blur, whose purpose is not to crate a blur but to help transition between harsh differences of the frames in per-pixel base, instead.

When combined with SMAA/FXAA and a Sharpen filter (LumaSharpen, preferebly, as post-processing AA reduces brightness), this can be as closest as ReShade can get to TAA.

It can be further imporved by using two clamp values. The first (and lower) treshold value only limits the luminescence and the second (and stronger) value blends both the color and the luminescence of current and previous frames. The missing of the crispiness and brightness of the resulting frame can be compansated with LumaSharpen easily.

Thanks for reading the very long text :)
The administrator has disabled public write access.
The following user(s) said Thank You: Scorpio82CO

I might have an idea about temporal anti-alising 4 months 2 weeks ago #2

sounds. good.. I create my version too with luluco´s TAA and HQ4X layers..I hope to see your results.. then I put mines..what do you think?
Last Edit: 4 months 2 weeks ago by Scorpio82CO.
The administrator has disabled public write access.
The following user(s) said Thank You: canceralp

I might have an idea about temporal anti-alising 4 months 2 weeks ago #3

Scorpio82CO wrote:
sounds. good.. I create my version too with luluco´s TAA and HQ4X layers..I hope to see your results.. then I put mines..what do you think?

Thanks,
But I can not give you any results, because I don't know how to code. I just supply the idea here and expect someone to write the code.
The administrator has disabled public write access.

I might have an idea about temporal anti-alising 4 months 2 weeks ago #4

Eagerly awaiting the video, I'm very sensitive to all types of aliasing as well
The administrator has disabled public write access.

I might have an idea about temporal anti-alising 4 months 2 weeks ago #5

The administrator has disabled public write access.
The following user(s) said Thank You: Scorpio82CO

I might have an idea about temporal anti-alising 4 months 2 weeks ago #6

Can you share a preset file with this style of makeshift TAA so I can test it ingame? It looks really good
The administrator has disabled public write access.
The following user(s) said Thank You: MaxG3D

I might have an idea about temporal anti-alising 4 months 2 weeks ago #7

In. fact.. its really impressive, you make the tutorial with game in 1080p, right?
i´ll gonna make one in that resolution,,
The administrator has disabled public write access.

I might have an idea about temporal anti-alising 4 months 1 week ago #8

Click Here

That's the preset I'm using. I have modified some files, like FXAA quality and also tripled some of the presets (obviously) as I needed them 3 times.

The in-game resolution is 1080p and no AA is enabled in-game. I recorded it with AMD ReLive in H265 (HVEC) format at original resolution, then upscaled it to 4K an re-encoded in H264 for youtube in a lossless way. Since youtube allows 55-65Mbit for 4K videos and my video is 40+ Mbit in the original 1080p footage, I believe youtube preserved every detail.
The administrator has disabled public write access.

I might have an idea about temporal anti-alising 4 months 1 week ago #9

"This one" here has only 2 Motion Blur (thus 3 frames blending) and uses less performance and gives better results. The logic is same, though.

I'm still hoping for someone to code the "pixel comparison" shader I tried to define in the first post, so I believe it will be much better results, even making Nvidia angry as they are the ones forcing properitary temporal anti-aliasing into the game B)
The administrator has disabled public write access.
The following user(s) said Thank You: Teh_pwnisher

I might have an idea about temporal anti-alising 4 months 1 week ago #10

canceralp wrote:
"This one" here has only 2 Motion Blur (thus 3 frames blending) and uses less performance and gives better results. The logic is same, though.

I'm still hoping for someone to code the "pixel comparison" shader I tried to define in the first post, so I believe it will be much better results, even making Nvidia angry as they are the ones forcing properitary temporal anti-aliasing into the game B)

Hi. I don't know much about other shaders (other than default shader pack), so i wonder where this SMAA HQ came from? I probably don't know something important.

ps
i probably get it, it is regular smaa, only uses color and z-buffer at same time, i wonder why this option gone in 3.0.
and now i see it still exist inside shader i wonder why it was removed from settings.
Моряк - с печки бряк.
Last Edit: 4 months 1 week ago by SilentPrayerCG.
The administrator has disabled public write access.

I might have an idea about temporal anti-alising 4 months 1 week ago #11

you can ignore the "unused" folder. It's regular SMAA: I have tempered with many files and created duplicates. For example, default FXAA comes with version 12, which means the 1st generation and 2nd quality. It has 3 generations, 9 quality options and all the code is defined there, so it is easily selectable. I set it for the highest quality and zero dithering at "39", as I am using FXAA 3 layers on top of each other.

For SMAA; I have enabled Predication (then renamed it to SMAA HQ) which works hand to hand with depth buffer but no matter what I try, SMAA has it's own flickering. It just doesn't play nice with the text, either. I love it in other games like Crysis 3, the Division, Far Cry Primal, Far Cry 4 etc. However, ReShade SMAA has issues for me, that's why I went with FXAA.

Also, 3 x FXAA removes more sub-pixel aliasing, almost equal to 2x MSAA.

Finally, with Crosire's advise, I renamed all the technique names uniquely so I was able to assign different paramters for the tripled shaders.
The administrator has disabled public write access.

I might have an idea about temporal anti-alising 4 months 1 week ago #12

canceralp wrote:
you can ignore the "unused" folder. It's regular SMAA: I have tempered with many files and created duplicates. For example, default FXAA comes with version 12, which means the 1st generation and 2nd quality. It has 3 generations, 9 quality options and all the code is defined there, so it is easily selectable. I set it for the highest quality and zero dithering at "39", as I am using FXAA 3 layers on top of each other.

For SMAA; I have enabled Predication (then renamed it to SMAA HQ) which works hand to hand with depth buffer but no matter what I try, SMAA has it's own flickering. It just doesn't play nice with the text, either. I love it in other games like Crysis 3, the Division, Far Cry Primal, Far Cry 4 etc. However, ReShade SMAA has issues for me, that's why I went with FXAA.

Also, 3 x FXAA removes more sub-pixel aliasing, almost equal to 2x MSAA.

Finally, with Crosire's advise, I renamed all the technique names uniquely so I was able to assign different paramters for the tripled shaders.

I just thought i find something new :D
I don't sure how this prediction work. I mean, for games when i tried to use z-depth, it need set edge threshold very low, lower than minimum value (0.050) about 0.001, to properly detect edges.
But it is not good value for regular color mode.
So i ended up with using 2 separate SMAA, one for color other for zdepth.

I didn't try 3 fxaa, but i bet it will be blurry.
Моряк - с печки бряк.
The administrator has disabled public write access.

I might have an idea about temporal anti-alising 4 months 1 week ago #13

I do it like:
1) FXAA
2) Lumasharpen
3) FXAA
4) Lumasharpen
5)....

If SMAA didn't flicker like that, I would've used it with FXAA, that would have been a better solution since one finds what other can not.

However, I started to believe SMAA was never meant to be used alone. It's a finalizing touch to temporal Supersampling + MSAA, instead.
The administrator has disabled public write access.

I might have an idea about temporal anti-alising 4 months 1 week ago #14

canceralp wrote:
I do it like:
1) FXAA
2) Lumasharpen
3) FXAA
4) Lumasharpen
5)....

If SMAA didn't flicker like that, I would've used it with FXAA, that would have been a better solution since one finds what other can not.

However, I started to believe SMAA was never meant to be used alone. It's a finalizing touch to temporal Supersampling + MSAA, instead.

I saw temporal smaa in watch dogs 1
and TAA+FXAA in the evil within 2
didn't saw smaa with something else though
the evil within 1 also have MLAA, but i don't see any difference between mlaa and smaa.

also

say pls, can i rearrange shaders? like you said - 1) fxaa I 2) sharpen I) fxaa II 4) sharpen II ?
I can drag around shaders in pipeline (a believe it called), but when reloading happens order rearranges, and it became 1) smaa I 2) smaa II 3) sharpen I 4) sharpen II
may be i do something wrong? whole idea of this in right order? i wonder why it resets every time.

ps
in ini preset file parameter TechniqueSorting actually display my order correctly, but not gui itself.
Моряк - с печки бряк.
Last Edit: 4 months 1 week ago by SilentPrayerCG.
The administrator has disabled public write access.

I might have an idea about temporal anti-alising 4 months 1 week ago #15

Thanks to Crosire, I have recently got rid of this problem.

Reshade main software recognizes a shader file with two properties; the file name and the technique.

File name can easily be changed in Windows, however files with same techniques will be forced to be treated as one by Reshade.

So, you have to find a text editor, lika Atom, and open the file, find the line that says "technique xxxx" and change the name of the technique, like FXAA1, FXAA2, etc. You must not use spaces also. Than Reshade will think they are different files with different techniques and treat them independently.
The administrator has disabled public write access.

I might have an idea about temporal anti-alising 4 months 1 week ago #16

so i should rename shader itself (in code, not file name only), ok, thank you, got it.
Моряк - с печки бряк.
The administrator has disabled public write access.

I might have an idea about temporal anti-alising 4 months 6 days ago #17

So, no one to help me code the shader?
The administrator has disabled public write access.

I might have an idea about temporal anti-alising 2 months 2 weeks ago #18

I would really like to, but I don't know anything about shader coding. Can we ping @Crosire as I feel this could be a major breakthrought for post process AA!!
The administrator has disabled public write access.