Question about custom Post processing aa

  • Posts: 261
4 years 3 months ago #1 by Kleio420
Im very new to programing shaders , this is a big request but if anyone has some free time and doesn't mind could someone outline some basics of ideas behind doing a post aa on a basic level showing the concepts of how one could and should work so i can look at it and learn from it using it as a base

Please Log in or Create an account to join the conversation.

  • Posts: 177
4 years 3 months ago - 4 years 3 months ago #2 by kingeric1992
I guess the general idea is to find edges --> by searching patterns, normals .etc and blur --> custom weighting on different size and scale accordingly.
(both can also take temporal and subpixel into account)

the goal is, for example
0.00|0.00|1.00|1.00|1.00
------------------------
1.00|1.00|1.00|1.00|1.00

to

0.00|0.25|0.50|0.75|1.00
------------------------
1.00|1.00|1.00|1.00|1.00

Please Log in or Create an account to join the conversation.

  • Posts: 261
4 years 3 months ago #3 by Kleio420

kingeric1992 wrote: I guess the general idea is to find edges --> by searching patterns and blur --> custom weighting accordingly.
(both can also take temporal and subpixel into account)

the goal is, for example

0.00|0.00|1.00|1.00|1.00
------------------------
1.00|1.00|1.00|1.00|1.00

to

0.00|0.25|0.50|0.75|1.00
------------------------
1.00|1.00|1.00|1.00|1.00

could if you don't mind helping me something im really interested into post aa in particular , give me a basic example based on reshades format so i can compare the dev explanation file with what u have then i can google what i dont know,I appreciate any help given

Please Log in or Create an account to join the conversation.

  • Posts: 177
4 years 3 months ago - 4 years 3 months ago #4 by kingeric1992
take this for example
0.00|0.00|0.00|0.00|0.00
------------------------
0.00|0.00|1.00|1.00|1.00
------------------------
1.00|1.00|1.00|1.00|1.00
if say (pseudo code)
scale = 2;
edgedirection.y = abs(right - middle);
edgedirection.x = abs(top - middle); //kinda like anisotropic bluring
edgerange = length(edgedirection);

color  = tex2d(texturein, middlecoord);
for(i=1; i<=scale , i++){
color += tex2d(texturein, middlecoord + edgerange * i * pixelsize * edgedirection);
color += tex2d(texturein, middlecoord - edgerange * i * pixelsize * edgedirection);
}
color /= scale*2 + 1;
return color;

you would get (assume sampling in clamp mode)
0.00|0.00|0.00|0.00|0.00
------------------------
0.00|0.40|0.60|0.80|1.00
------------------------
1.00|1.00|1.00|1.00|1.00
ofc the actual edge finding & weighting (using 1 here) would have more restrictions and depend on more terms, but you get the idea.
and since SMAA or FXAA are provided in framework, you can check their algorithm for details on how they sample and weight.
The following user(s) said Thank You: Kleio420

Please Log in or Create an account to join the conversation.