FXAA Supersampling Question!
- Constantine PC
- Topic Author
From Marty Mcfly in a previous thread called "fxaa ultra quality":
Downsampling 4life!
FXAA can produce an extremely smooth image when running it internally with 2x screensize. ReShade allows it. If I run any game on 1920x1080 but use an internal resolution of all render target textures of 3840x2160, applying a strong FXAA, the resulting image is very smooth since the FXAA reliably finds all aliased edges but the rendering in higher resolution lowers the heavy blurring plus the linear filter applied also smoothens the image. You can almost fake true Downsampling results. I have to mention though that running any ReShade shader (especially big ones like the Framework or MasterEffect) with a globally higher resolution means quite a loss of fps so it's better to detach AA from it.
Now I find myself very interested in this method. What exactly should I be tweaking for this super-sample effect?
(EDIT: These lines seem to do nothing to the quality/no supersample)
Is it these lines in Util.h ?
texture edgesTex
{
Width = BUFFER_WIDTH;
Height = BUFFER_HEIGHT;
Format = R8G8B8A8; //R8G8 is also an option
};
Or is it something else?
What other shaders are also affected by this super sample tweak?
Thanks for checking this out
Please Log in or Create an account to join the conversation.
- MaxG3D
Please Log in or Create an account to join the conversation.
- Constantine PC
- Topic Author
Please Log in or Create an account to join the conversation.
- JBeckman
(From forum.step-project.com/topic/2894-temporal-vs-edge-vs-smaa/ )
From SMAA.h:
* After this point you can choose to enable predicated thresholding,
* temporal supersampling and motion blur integration:
EDIT: Though I think it relies on the velocity buffer which ReShade does not support as far as I'm aware.
(Which is why SMAA T2X and the others are not available.)
Full text quote:
* After this point you can choose to enable predicated thresholding,
* temporal supersampling and motion blur integration:
*
* a) If you want to use predicated thresholding, take a look into
* SMAA_PREDICATION; you'll need to pass an extra texture in the edge
* detection pass.
*
* b) If you want to enable temporal supersampling (SMAA T2x):
*
* 1. The first step is to render using subpixel jitters. I won't go into
* detail, but it's as simple as moving each vertex position in the
* vertex shader, you can check how we do it in our DX10 demo.
*
* 2. Then, you must setup the temporal resolve. You may want to take a look
* into SMAAResolve for resolving 2x modes. After you get it working, you'll
* probably see ghosting everywhere. But fear not, you can enable the
* CryENGINE temporal reprojection by setting the SMAA_REPROJECTION macro.
* Check out SMAA_DECODE_VELOCITY if your velocity buffer is encoded.
*
* 3. The next step is to apply SMAA to each subpixel jittered frame, just as
* done for 1x.
*
* 4. At this point you should already have something usable, but for best
* results the proper area textures must be set depending on current jitter.
* For this, the parameter 'subsampleIndices' of
* 'SMAABlendingWeightCalculationPS' must be set as follows, for our T2x
* mode:
*
* @SUBSAMPLE_INDICES
*
* | S# | Camera Jitter | subsampleIndices |
* +----+
+
+
* | 0 | ( 0.25, -0.25) | float4(1, 1, 1, 0) |
* | 1 | (-0.25, 0.25) | float4(2, 2, 2, 0) |
*
* These jitter positions assume a bottom-to-top y axis. S# stands for the
* sample number.
*
* More information about temporal supersampling here:
* iryoku.com/aacourse/downloads/13-Anti-Al...s-in-CryENGINE-3.pdf
*
* c) If you want to enable spatial multisampling (SMAA S2x):
*
* 1. The scene must be rendered using MSAA 2x. The MSAA 2x buffer must be
* created with:
* - DX10: see below (*)
* - DX10.1: D3D10_STANDARD_MULTISAMPLE_PATTERN or
* - DX11: D3D11_STANDARD_MULTISAMPLE_PATTERN
*
* This allows to ensure that the subsample order matches the table in
* @SUBSAMPLE_INDICES.
*
* (*) In the case of DX10, we refer the reader to:
* - SMAA::detectMSAAOrder and
* - SMAA::msaaReorder
*
* These functions allow to match the standard multisample patterns by
* detecting the subsample order for a specific GPU, and reordering
* them appropriately.
*
* 2. A shader must be run to output each subsample into a separate buffer
* (DX10 is required). You can use SMAASeparate for this purpose, or just do
* it in an existing pass (for example, in the tone mapping pass, which has
* the advantage of feeding tone mapped subsamples to SMAA, which will yield
* better results).
*
* 3. The full SMAA 1x pipeline must be run for each separated buffer, storing
* the results in the final buffer. The second run should alpha blend with
* the existing final buffer using a blending factor of 0.5.
* 'subsampleIndices' must be adjusted as in the SMAA T2x case (see point
* b).
*
* d) If you want to enable temporal supersampling on top of SMAA S2x
* (which actually is SMAA 4x):
*
* 1. SMAA 4x consists on temporally jittering SMAA S2x, so the first step is
* to calculate SMAA S2x for current frame. In this case, 'subsampleIndices'
* must be set as follows:
*
* | F# | S# | Camera Jitter | Net Jitter | subsampleIndices |
* +----+----+
+
+
+
* | 0 | 0 | ( 0.125, 0.125) | ( 0.375, -0.125) | float4(5, 3, 1, 3) |
* | 0 | 1 | ( 0.125, 0.125) | (-0.125, 0.375) | float4(4, 6, 2, 3) |
* +----+----+
+
+
+
* | 1 | 2 | (-0.125, -0.125) | ( 0.125, -0.375) | float4(3, 5, 1, 4) |
* | 1 | 3 | (-0.125, -0.125) | (-0.375, 0.125) | float4(6, 4, 2, 4) |
*
* These jitter positions assume a bottom-to-top y axis. F# stands for the
* frame number. S# stands for the sample number.
*
* 2. After calculating SMAA S2x for current frame (with the new subsample
* indices), previous frame must be reprojected as in SMAA T2x mode (see
* point b).
*
* e) If motion blur is used, you may want to do the edge detection pass
* together with motion blur. This has two advantages:
*
* 1. Pixels under heavy motion can be omitted from the edge detection process.
* For these pixels we can just store "no edge", as motion blur will take
* care of them.
* 2. The center pixel tap is reused.
*
* Note that in this case depth testing should be used instead of stenciling,
* as we have to write all the pixels in the motion blur pass.
*
* That's it!
*/
(To avoid ghosting artifacts smaa reprojection is recommended which I think is what the velocity buffer would be needed for to work correctly.)
Please Log in or Create an account to join the conversation.
- Constantine PC
- Topic Author
Please Log in or Create an account to join the conversation.
- roxahris
Having said that, I'd be curious to see pictures of what it looks like - not to mention an idea of what settings one would need to change to get it searching properly. Oh, and "temporal supersampling" has nothing to do with this.
Please Log in or Create an account to join the conversation.
- Kleio420
JBeckman wrote: It's in SMAA.h and perhaps FXAA.h too.
(From forum.step-project.com/topic/2894-temporal-vs-edge-vs-smaa/ )
From SMAA.h:
this doesnt work currently with reshade , what marty was saying was when fxaa/smaa go to start up they grab the screen size idk why or what this does for either or but im sure either him or someone else could explain this better. Also fxaa does have a supersampling effect but its never been released to the public
Please Log in or Create an account to join the conversation.
- JBeckman
(Something like upscaling the shader or something in the shader to a higher resolution than what is being rendered I assume, trying to brute force it like downsampling to improve overall quality? But without the actual performance hit from render downsampling as it's only being done to the shader?)
EDIT: Then I guess it could potentially work for other shaders too such as improving the precision of ambient occlusion or depth of field but it might work better for shaders for removing aliasing, very interesting.
(And AO/DOF likely have a higher framerate impact too if you were to attempt this with those shaders.)
Please Log in or Create an account to join the conversation.
- Kleio420
im pretty sure most of the shaders already do that to help improve artifacting. Was just saying smaa tx2 and up modes dont currently work in reshade, fxaa 4.0(had a supersampling effect) but current nvidia driver fxaa does not feature this nor do i think they will ever include it kinda silly not to considering fallout 4 , and the witcher 3 use a similar method to fxaa 4.0 that cost almost nothing to run. To the op wanting to improve quality of fxaa theres a dime a dozen of methods out there its more of a finding someone willing to put in the effort of using whats good in one and in another then making a custom method for reshade only each post aa has their pro's and con's just like any shader , and i think if you need to "supersample" a post aa you should just save up buy a higher resolution monitor if you have the system power to go wasting on something like thatJBeckman wrote: Ah so it's something different entirely, then I think I understand.
(Something like upscaling the shader or something in the shader to a higher resolution than what is being rendered I assume, trying to brute force it like downsampling to improve overall quality? But without the actual performance hit from render downsampling as it's only being done to the shader?)
EDIT: Then I guess it could potentially work for other shaders too such as improving the precision of ambient occlusion or depth of field but it might work better for shaders for removing aliasing, very interesting.
(And AO/DOF likely have a higher framerate impact too if you were to attempt this with those shaders.)
Please Log in or Create an account to join the conversation.
- JPulowski
Please Log in or Create an account to join the conversation.
- Constantine PC
- Topic Author
Kleio420 wrote:
im pretty sure most of the shaders already do that to help improve artifacting. Was just saying smaa tx2 and up modes dont currently work in reshade, fxaa 4.0(had a supersampling effect) but current nvidia driver fxaa does not feature this nor do i think they will ever include it kinda silly not to considering fallout 4 , and the witcher 3 use a similar method to fxaa 4.0 that cost almost nothing to run. To the op wanting to improve quality of fxaa theres a dime a dozen of methods out there its more of a finding someone willing to put in the effort of using whats good in one and in another then making a custom method for reshade only each post aa has their pro's and con's just like any shader , and i think if you need to "supersample" a post aa you should just save up buy a higher resolution monitor if you have the system power to go wasting on something like thatJBeckman wrote: Ah so it's something different entirely, then I think I understand.
(Something like upscaling the shader or something in the shader to a higher resolution than what is being rendered I assume, trying to brute force it like downsampling to improve overall quality? But without the actual performance hit from render downsampling as it's only being done to the shader?)
EDIT: Then I guess it could potentially work for other shaders too such as improving the precision of ambient occlusion or depth of field but it might work better for shaders for removing aliasing, very interesting.
(And AO/DOF likely have a higher framerate impact too if you were to attempt this with those shaders.)
I ended up using DSR...
It was more of a curiosity question anyways.
Please Log in or Create an account to join the conversation.
- Kleio420
dsr is nice on some games upgraded my monitor to 1440p so i dont use anything other then post aaConstantine PC wrote:
Kleio420 wrote:
im pretty sure most of the shaders already do that to help improve artifacting. Was just saying smaa tx2 and up modes dont currently work in reshade, fxaa 4.0(had a supersampling effect) but current nvidia driver fxaa does not feature this nor do i think they will ever include it kinda silly not to considering fallout 4 , and the witcher 3 use a similar method to fxaa 4.0 that cost almost nothing to run. To the op wanting to improve quality of fxaa theres a dime a dozen of methods out there its more of a finding someone willing to put in the effort of using whats good in one and in another then making a custom method for reshade only each post aa has their pro's and con's just like any shader , and i think if you need to "supersample" a post aa you should just save up buy a higher resolution monitor if you have the system power to go wasting on something like thatJBeckman wrote: Ah so it's something different entirely, then I think I understand.
(Something like upscaling the shader or something in the shader to a higher resolution than what is being rendered I assume, trying to brute force it like downsampling to improve overall quality? But without the actual performance hit from render downsampling as it's only being done to the shader?)
EDIT: Then I guess it could potentially work for other shaders too such as improving the precision of ambient occlusion or depth of field but it might work better for shaders for removing aliasing, very interesting.
(And AO/DOF likely have a higher framerate impact too if you were to attempt this with those shaders.)
I ended up using DSR...
It was more of a curiosity question anyways.
Please Log in or Create an account to join the conversation.
- JBeckman
(Still 2880 is a 50% increase and for performance reasons that and SMAA via ReShade is what I try to use in most games, works pretty well most of the time, for older games 3360x2100 with a 75% res increase over 1920x1200 is a good option as well but it's not usable in the newest games due to just how demanding those become when played at a very high resolution, 3840x2400 isn't viable at all outside of less advanced games or simply older games, sub-20 FPS most of the time whereas I try to at least stay over 30, preferably over 50.)
Please Log in or Create an account to join the conversation.