📅 July 16, 2014
The SweetFX Shader Suite is a vendor-neutral program that provides post-processing effects to Windows DirectX 9, 10, and 11 games. Are the default game colors a little on the bland side? Need to sharpen the image? Wish for improved anti-aliasing using SMAA? SweetFX will provide those features — and more — to improve the visual quality of those dark and gritty pixels. Best of all, SweetFX introduces almost no performance lag, so if a game runs fluidly at 60fps before SweetFX, it will also run close to or at 60fps after SweetFX effects are applied — including SMAA anti-aliasing.
A sufficient number of individually customizable effects are provided by default, but if additional effects are desired, anyone is free to create his own using the proprietary high-level shader language (HLSL).
Despite the benefits and popularity of SweetFX, detailed documentation is sparse and without screenshots that demonstrate the effects. So, SweetFX learning is still a trial and error process in the dark. A few articles provided here will help show what SweetFX can do and how to configure the various effects. This is not a tutorial about how to make SweetFX operate in Linux, so we will be using Windows games on a Windows machine to ensure proper DirectX functionality.
This tested version of SweetFX is 1.5.1, which is the current version as of this writing. There are 21 effects to get started with, and there is a custom template for those wishing to create their own effects.
Some effects are more subtle than others and make it tricky to capture screenshots. Here are a few of the more noticeable effects that have have been exaggerated to show up in small screenshots.
Keep in mind that SweetFX applies post-processing effects. That means the entire image, including text and overlays, will be affected. Below are screenshots from the game Fallout: New Vegas. Though effects can be combined, each effect is enabled one at a time for comparison.
Produces CRT scanlines that emulate the appearance of a rounded TV.
Adds borders to the top, bottom, and sides of the image. Border color can be changed, so adding black bars to the top and bottom of the image will produce a letterbox effect.
Thickens lines and produces a “cartoony” effect.
Attempts to digitally process the image similar to the way the Cineon System handles film. Cineon is the name of the system, and DPX (Digital Picture Exchange) is the name of the file format used to store pixel information.
Scatters pixels to produce the effect of looking through frosted glass. All pixels are scattered, so even text is affected.
HDR (High Dynamic Range)
HDR (High Dynamic Range) produces better blacks and better light areas with a greater range without losing detail in those areas. Bottomline: It make colors look better. If the image appears slightly washed out, HDR will improve the darks, lights, and colors in between. However, in some games, this can lose details in the dark areas making some darks too dark, thus requiring curve balancing to relighten the areas. In Fallout: New Vegas, HDR works well.
Everything below a certain point becomes solid black, and everything above a certain point becomes solid white.
Lift Gamma Gain
Provides fine-grain tuning of gamma levels for shadows, midtones, and highlights. Other effects provide gamma tuning to a limited degree. For those who need that special touch. The result is purple if set to be purple in the example. Like Curves, this one is difficult to demonstrate in a screenshot. Thus, the purple hue for emphasis.
Converts the image to black and white. Actually, it seems fitting in Fallout: New Vegas.
Sepia by itself will desaturate and colorize the image, but other colors remain. This is best combined with Monochrome and Vignette to produce the old-time photo appearance popular in old westerns. The plain black and white produced by Monochrome is rather boring, but when combined with other effects, such as Sepia, Goodsprings looks like it was stuck in the 1800’s.
SMAA (Subpixel Morphological Anti-Aliasing)
There is a new darling in the world of anti-aliasing called SMAA (Subpixel Morphological Anti-Aliasing) that produces incredibly impressive results with hardly any performance drop.
SMAA easily beats SSAA (Super Sampling Anti-Aliasing) and MSAA (Multi-Sampling Anti-Aliasing) (Yes, SSAA and MSAA are different techniques) while maintaining practically the full speed of the game. Even at its highest, “ultra” settings, SMAA produces anti-aliasing results that exceed the best that Fallout: New Vegas can offer through in-game settings, and SMAA does so without a drop of lag. On the other hand, the game’s built-in MSAA will cause the game to stutter and lag in framerate with slight aliasing still present. SMAA even cleans up the slight aliasing that MSAA misses. For best anti-aliasing, combine SMAA with FXAA (Fast Approximate Anti-Aliasing).
While not 100% perfect in every game and in every case, SMAA comes very, very close. SMAA is probably the single most important reason to use SweetFX.
Sidenote: Do not confuse SMAA with MSAA. The two are completely different despite containing the same letters.
Splitscreen does exactly what it sounds like it would do. This is useful when testing tweaks and custom presets to see a real-time before and after view of the same scene. Other modes allow three-part, wavy, and horizontal variations.
Dance down the radioactive yellow brick road in Technicolor! For those who enjoy older movies dating from 1935 to c. 1960, the Technicolor effect attempts to recreate the feel of the three-strip (Process 4) Technicolor dye-transfer process used to produce color movies in those days.
The SweetFX effect seems rather limited and lackluster considering what the Technicolor technology was capable of achieving during its time, but the Technicolor effect can produce some interesting coloring effects that serve as the base for further post-processing.
Lift Gamma Gain offers more gamma control in the shadows, midtones, and highlights, but Tonemap includes settings that adjust exposure (like a camera), saturation, and a process known as defogging where a color tint may be selectively reduced or removed.
Vibrance saturates or desaturates. Want more color? Increase saturation. Want less color? Decrease saturation. Vibrance also allows saturation/desaturation based upon a specific color.
Vignette produces faded dark areas in the corners to produce the worn look and feel common in old, 1800’s photographs. When combined with Monochrome and Sepia, Fallout: New Vegas feels like it is being played through an old-time TV screen. Here, other colors are still present because no other effects are applied.
Other effects are available, but they are best viewed during an active game, not in screenshots. (Their screenshots would all look alike.)
All of the effects shown are added by SweetFX. Fallout: New Vegas does not support any of these effects from within the game itself. The beauty of the arrangement is that SweetFX effects can be combined (SMAA + HDR + Vibrance + Tonemap) to drastically improve the image to make shadows darker, colors more subtle, and aliased lines smoothed better than any in-game option can provide and without any loss of performance. During playback, Fallout: New Vegas continued to run smoothly no matter how many effects were enabled. Absolutely no graphical slowdown was detected. This might vary per system, so experiment.
How to Install
First, download and install the free SweetFX package [http://forums.guru3d.com/showthread.php?t=381912] from Guru3D. This is the official release thread, and it contains other helpful information and compatibility details because SweetFX is intended for 32-bit games.
For most games, simply uncompress the entire SweetFX package into the same directory as the game’s executable while keeping the SweetFX directory structure intact.
There are two important files: d3d9.dll is the SweetFX executable for DirectX9 games, and dxgi.dll is the SweetFX executable for DirectX 10/11 games. It is okay to place them together. The game will use only what it needs. The important point to note is that d3d9.dll or dxgi.dll must exist with the game’s .exe file. Do not place d3d9.dll or dxgi.dll in the system32 directory or anywhere else. d3d9.dll (dxgi.dll) is loaded automatically when the game runs.
Some games will require different locations, so check the included SweetFX compatibility file and online support for details. Also, a few games simply will not work with SweetFX due to anti-cheat mechanisms.
Can We Use SweetFX and ENB Together?
There is another immensely popular graphics modification called ENBSeries [http://enbdev.com/] that provides advanced image quality improvements but does so during the rendering stage of the graphics pipeline. Yes, ENB and SweetFX can be used together to produce incredibly beautiful visual effects.
However, both ENB and SweetFX use d3d9.dll for their main files. To get around this, install SweetFX normally, and then rename the SweetFX d3d9.dll to something else, such as SweetFX.dll.
Install the ENB wrapper version, and edit the ProxyLibrary entry in the enblocal.ini file to point to the renamed SweetFX.dll file.
[PROXY] EnableProxyLibrary=false InitProxyFunctions=true ProxyLibrary=other_d3d9.dll
[PROXY] EnableProxyLibrary=true InitProxyFunctions=true ProxyLibrary=SweetFX.dll
Set EnableProxyLibrary and InitProxyFunctions to true so SweetFX will load and take effect automatically.
ENB can cause a drastic performance drop, so if the game crawls to a halt with ENB and SweetFX enabled, it is most likely the fault of ENB, not SweetFX. SweetFX adds very little overhead with or without ENB. One advantage of using SweetFX with ENB is to offload the post-processor effects to SweetFX so ENB has less to busy itself with.
SweetFX included a few default presets in SweetFX\Presets. SweetFX points to one effects file at a time as specified by the SweetFX_preset.txt file.
#include "SweetFX_settings.txt" //#include "SweetFX\Presets\Default_1.5_settings.txt"
The default 1.5.1 preset file is SweetFX_settings.txt. To change this, comment out the line (in case we want to use it again), and add a new line pointing to one of the presets in the SweetFX\Preset directory. Two forward slashes comment out a line just as they do in C++ or Java. Specify a relative path inside double quotes, and include the filename extension.
#include "SweetFX\Presets\Torchlight2_TFL.txt" //#include "SweetFX_settings.txt" //#include "SweetFX\Presets\Default_1.5_settings.txt"
Now, SweetFX will use the Torchlight2_TFL.txt settings file, which produces an appropriately rusty image in Fallout: New Vegas. Use backslashes (\) to separate directories in the path because this is for Windows, not Linux.
Obtaining Premade Presets
Users may write their own SweetFX settings, or they can download more from the SweetFX Settings Database [http://sfx.thelazy.net/games/], which contains user-submitted SweetFX settings for a large variety of games. Comparison screenshots are provided in order to preview the effect settings will have.
SweetFX preset files are game-independent. Any SweetFX settings file may be used with any other game, though the effects might not appear identical.
Each Game Needs Its Own SweetFX
SweetFX is custom and local to the game it is installed for. To apply SweetFX to three different games, each game will need its own copy of SweetFX. Simply uncompress SweetFX into each game directory.
When SweetFX is active for a game, its setting will apply to that game only. However, the settings files can be shared and copied among games because they are not game-dependent for operation.
SweetFX Key Assignments
SweetFX has three keyboard shortcuts assigned to it by default.
- PrtScrn – Take a screenshot
- Scroll Lock – Toggle SweetFX ON and OFF
- Pause – Reload the SweetFX settings filename
In the event of key conflicts, the default assignments can be changed to different keys by editing the injector.ini file with different keycodes.
For a game, such as Fallout: New Vegas, that already uses the PrtScrn key to take screenshots, it might be a good idea to change the SweetFX screenshot key to something else in order to avoid conflict. If Fallout: New Vegas and SweetFX both want to use the same screenshot key, then Fallout: New Vegas will win and screenshots will be captured without the SweetFX effects applied.
In the example below, SweetFX changes its screenshot key to the Insert key on the keyboard.
;make screenshot keycode key_screenshot = 45 ; 45 = Insert key
Now, there are two screenshots active for the game. When PrtScrn is pressed, Fallout: New Vegas takes its own screenshot of the scene without any SweetFX effects applied. When the INsert key is pressed, SweetFX takes its own screenshot with the SweetFX effects visible.
Rarely will a single settings file appease everyone. Custom tweaks are allowed to get the “perfect” look. This is accomplished by editing a SweetFX settings file and checking the game to see if it looks right. Repeat, repeat, repeat until the game looks brilliant.
Settings can be adjusted while the game is running. There is no need to close the game, edit the file, restart the game, check the effects, close the game, and so on. That is much too time-consuming.
To get started editing settings, do so with a file dedicated for testing. Avoid overwriting any of the default files. Copy SweetFX_settings.txt and save it as game.txt (or any other descriptive name) in the same directory.
Update SweetFX_preset.txt to point to the new file.
#include "game.txt" //#include "SweetFX_settings.txt" //#include "SweetFX\Presets\Default_1.5_settings.txt"
We can also place the new settings file in SweetFX\Presets to keep things tidy, but it does not matter. Ensure that SweetFX_preset.txt points to the file being edited.
SweetFX_settings.txt is well-commented, so open it for use as a reference taking care not to edit it by mistake. Now, here is the process.
1. Run the game in a window mode, not full-screen.
2. Alt+Tab out of the game.
3. Edit a setting in the game.txt settings file. Save the file.
4. Alt+Tab back into the game.
5. Reload the SweetFX settings by pressing the reload key, which is Pause by default. The settings take immediate effect. Sometimes this is not necessary, and the effects will be applied automatically when re-entering the game.
6. How does the image look? Toggle the SweetFX on and off by pressing the Scroll Lock key for comparison. If there is no apparent change, check that the correct file was edited, and check if the settings were saved before returning to the game. Also, check if the adjustment was significant enough to make a difference.
7. For further tweaking, repeat steps 2 through 7 until satisfied with the results.
SweetFX provides a way to enhance graphics in ways not supported by the games themselves, so this is an excellent way to breathe new life into older games or as a way to resolve graphical unhappiness where no other solution exists. For consistency, only Fallout: New Vegas was shown in this article. Other games might produce different results, so feel free to experiment.
This completes the initial overview and setup. The following articles will introduce and describe some of the individual effects.
- SweetFX Shader Suite
- SweetFX – Splitscreen
- SweetFX – Cartoon
- SweetFX – Technicolor
- SweetFX – Monochrome
- SweetFX – Bloom
- SweetFX – Border
- SweetFX – HDR
- SweetFX – Sepia
- SweetFX – SMAA
- SweetFX – Vibrance
- SweetFX – Cineon DPX
- SweetFX – Explosion
- SweetFX – LumaSharpen
- SweetFX – Tonemap
- SweetFX – Lift Gamma Gain
- SweetFX – Vignette
- SweetFX – Levels