Fast_FXAA_sharpen_DOF_and_AO

More
1 month 1 week ago #1 by rj200
Fast_FXAA_sharpen_DOF_and_AO was created by rj200
Hello, I've written a shader that provides fast versions of several standard effects in one. The idea is to be a faster option but still with decent quality.

Feedback welcome.

I'm curious if people with better hardware than me get similar framerate improvement compared to other ambient occlusion options (see benchmark in link). To get the best performance, my tactic was to minimize memory reads and shader passes.

github.com/rj200/Fast_FXAA_sharpen_DOF_and_AO_for_reshade

File Attachment:
The following user(s) said Thank You: acknowledge, MacTir

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

More
1 month 6 days ago #2 by macron
Replied by macron on topic Fast_FXAA_sharpen_DOF_and_AO
Hello! Got errors with rx580:

Fast_FXAA_sharpen_DOF_and_AO.fx(641,19-27): error X4505: maximum temp register index exceeded
Fast_FXAA_sharpen_DOF_and_AO.fx(641,20-30): error X4505: maximum temp register index exceeded
Fast_FXAA_sharpen_DOF_and_AO.fx(642,19-27): error X4505: maximum temp register index exceeded
Fast_FXAA_sharpen_DOF_and_AO.fx(642,20-30): error X4505: maximum temp register index exceeded


 
The following user(s) said Thank You: rj200

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

More
1 month 2 days ago #3 by rj200
Replied by rj200 on topic Fast_FXAA_sharpen_DOF_and_AO
Thanks, I have seen the same error durnig development, and thought I had fixed it.

I got it in DirectX9 games while Direct 11 games worked fine - it's a limit on registers of Shader Model 3 in DirectX9.

But perhaps it also depends on the card and driver? You have AMD and all I have for testing is NVIDIA. The compiled code and number of registers needed may be different.

There is a workaround: If you set the global preprocessor definition AO_POINTS to the quality level you want it should work (between 2 and 12). Using a fixed preprocessor definition instead of a variable GUI slider to set the quality lets DirectX optimize the complied code better and not run out of registers.

I will attempt to fix the default settings of the shader.... (probably by having fewer quality level options).

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

More
1 month 2 days ago #4 by rj200
Replied by rj200 on topic Fast_FXAA_sharpen_DOF_and_AO
I have fixed it by removing the dynamic AO Quality slider. You now have to change quality by editing the preprocessor definition FAST_AO_POINTS*. This forces ReShade to compile a smaller optimized version using fewer registers.

Try updating and let me know if you still get the error.

Had to rename it - for some reason ReShade won't show definitions less than 10 characters in the GUI!

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

More
1 month 2 days ago #5 by macron
Replied by macron on topic Fast_FXAA_sharpen_DOF_and_AO
Yes, now it works fine. Thank you. Yes, I make some experiments with the old DirectX 9 game (STALKER SoC engine).

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

More
4 weeks 19 hours ago #6 by AlucardDH
Replied by AlucardDH on topic Fast_FXAA_sharpen_DOF_and_AO
In OpenGL, (tested in Half-life), the shader doesn't work because the word "smooth" seems reserved. (it's used in your shader as a variable).
Changing the variable name to anything else works.
The following user(s) said Thank You: rj200

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

More
3 weeks 3 days ago #7 by rj200
Replied by rj200 on topic Fast_FXAA_sharpen_DOF_and_AO
Many thanks. I've renamed the offending variable and uploaded a new version.

I've also made some minor tweaks to Ambient Occlusion to make it look even better.

Get version 1.2 here:
github.com/rj200/Fast_FXAA_sharpen_DOF_and_AO_for_reshade
The following user(s) said Thank You: AlucardDH

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