SweetFX – LumaSharpen

004Does your unaltered game appear slightly out of focus or fuzzy? (No, depth of field effects do not count.) SweetFX Lumasharpen sharpens the image to enhance details. The end result is similar to what would be seen after an image has been enhanced using the Unsharp Mask filter in GIMP or Photoshop.

LumaSharpen can produce a highly-sharpened gritty-world effect, or it can give edges a slightly more distinct “pop-out” feel depending upon its application.

However, this is another “less is more” effect. While a little sharpening might make the image appear better, more sharpening can make the image appear worse than the original by over-sharpening it. Experiment, and apply in moderation.

Enabling

Activate LumaSharpen by enabling it in the SweetFX_settings.txt file.

#define USE_LUMASHARPEN 1
//[0 or 1] LumaSharpen : Also sharpens the antialiased edges which makes them less smooth - I'm working on fixing that.

Settings

Specific LumaSharpen settings are adjusted in SweetFX_settings.txt within the LumaSharpen settings section. (Original misspellings and text preserved.)

/*-----------------------------------------------------------.
 / LumaSharpen settings /
 '-----------------------------------------------------------*/
// -- Sharpening --
#define sharp_strength 0.65 //[0.10 to 3.00] Strength of the sharpening
#define sharp_clamp 0.035 //[0.000 to 1.000] Limits maximum amount of sharpening a pixel recieves - Default is 0.035

// -- Advanced sharpening settings --
#define pattern 2 //[1|2|3|4] Choose a sample pattern. 1 = Fast, 2 = Normal, 3 = Wider, 4 = Pyramid shaped.
#define offset_bias 1.0 //[0.0 to 6.0] Offset bias adjusts the radius of the sampling pattern.
 //I designed the pattern for offset_bias 1.0, but feel free to experiment.

// -- Debug sharpening settings --
#define show_sharpen 0 //[0 or 1] Visualize the strength of the sharpen (multiplied by 4 to see it better)

A number of settings exist, but, in practice, sharp_strength and sharp_clamp tend to produce the most noticeable changes. This might vary by game, though, so experiment.

How It Works

According to the Shaders/LumaSharpen.h file that defines how the effect is applied, LumaSharpen works its magic by blurring the original pixel with the surrounding pixels and then subtracting the blur.

Patterns

A pattern defines how the effect is applied, and the pattern settings specifies which type of LumaSharpen pattern to use.

The Shaders/LumaSharpen.h file lists the patterns available, and there are more than four patterns. In fact, there are six of them. However, patterns 8 and 9 are supposedly slower in operation and no real change was apparent when they were used, so there was no real need to use them. The four endorsed patterns are more than enough.

Pattern 2, the default, is a good compromise between speed and quality. In practice, there was not much of a difference among the patterns. They all sharpened the image with identical results.

Beware of SMAA

Since SweetFX applies post-processing effects, everything will be sharpened, including other SweetFX effects. This is most apparent with the SweetFX SMAA (Subpixel Morphological Anti-Aliasing) effect. LumaSharpen will sharpen the anti-aliased edges (that were smoothed out by SMAA) and make them appear jagged again. Thus, SMAA is negated. During testing, SMAA and LumaSharpen seemed to undo each other, so use one or the other instead of both. A balance might exist, but personal tests proved tedious in making this happen.

The SweetFX_settings.txt comments (in version 1.5.1) hint at a promise of resolving this issue in the future, but, for now, it’s true. LumaSharpen ruins SMAA.

Screenshots

Here are a few screenshots from the game Fallout: New Vegas with the LumaSharpen effect applied. All use Pattern 2 except for 002 (Pattern 9). To avoid clutter, only the relevant LumaSharpen changes are listed instead of listing all settings.

Overall, LumaSharpen is not an essential effect, but when used, it is best applied sparingly. Smaller values produce better results. LumaSharpen is more noticeable in the actual game rather than in these screenshots, which have been resized and compressed.

001

LumaSharpen 001

LumaSharpen 001

// -- Sharpening --
#define sharp_strength 0.6
#define sharp_clamp 0.050
// -- Advanced sharpening settings --
#define pattern 2
#define offset_bias 1.0

002 Pattern 9

LumaSharpen 002

LumaSharpen 002

// -- Sharpening --
#define sharp_strength 0.6
#define sharp_clamp 0.050
// -- Advanced sharpening settings --
#define pattern 9
#define offset_bias 1.0

003

LumaSharpen 003

LumaSharpen 003

// -- Sharpening --
#define sharp_strength 2.0
#define sharp_clamp 0.050
// -- Advanced sharpening settings --
#define pattern 2
#define offset_bias 1.0

004

LumaSharpen 004

LumaSharpen 004

// -- Sharpening --
#define sharp_strength 2.0
#define sharp_clamp 0.050
// -- Advanced sharpening settings --
#define pattern 2
#define offset_bias 6.0

005

LumaSharpen 005

LumaSharpen 005

// -- Sharpening --
#define sharp_strength 2.0
#define sharp_clamp 1.0
// -- Advanced sharpening settings --
#define pattern 2
#define offset_bias 1.0

SweetFX Effects

, ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: