What Refraction Does
When enabled, refraction replaces the default contrast pass (brightness, saturation, contrast) with a shader that simulates glass refraction. Instead of simply adjusting colors, it distorts the background image, creating a more physically realistic glass effect.Visual Description
Refraction creates the appearance of:- Light bending at the edges of windows (like looking through curved glass)
- Subtle distortion that increases toward window borders
- Optional chromatic aberration (RGB color separation)
- Lens-like bulging or concave effects
Refraction is disabled by default. Set Refraction Strength above 0 to enable the effect.
Refraction Strength
Controls how intense the distortion effect is.- Range: 0 to 30
- Default: 0 (disabled)
- Slider labels: Off → Strong
Effect
- 0 - Refraction disabled, normal contrast pass used
- 1-10 - Subtle glass effect, suitable for everyday use
- 11-20 - Moderate distortion, noticeable lens effect
- 21-30 - Strong distortion, dramatic artistic effect
Internally, the strength is normalized to a 0.0-1.0 range (divided by 30.0) before being passed to the shader.
Usage Tips
- Start with strength 5-10 for a subtle enhancement
- Use 15-20 for a prominent glass aesthetic
- Values above 25 create surreal, artistic distortions
Refraction Mode
Controls the type of lens distortion applied.Basic (Bulge)
Creates a convex lens effect - the background appears to bulge outward at the edges of the window, as if looking through the outside of a glass bubble.- Best for: Subtle, natural-looking glass effects
- Visual: Edges pushed outward, center relatively stable
- Use case: Everyday desktop aesthetics
Concave (Lens)
Creates a concave lens effect - the background appears to curve inward at the edges, as if looking through a magnifying glass or the inside of a glass bowl.- Best for: Dramatic, artistic effects
- Visual: Edges pulled inward, stronger central distortion
- Use case: High-contrast themes, showcase setups
The mode is selected via a combo box with two options: “Basic (Bulge)” (mode 0) and “Concave (Lens)” (mode 1).
Refraction Edge Size
Controls how wide the refraction effect extends from the window borders.- Range: 0 to 30
- Default: 20
- Slider labels: Small → Wide
- Actual pixels: Range value × 10 (0-300 pixels)
Effect
- Small values (1-10) - Refraction only at immediate window edges
- Medium values (11-20) - Refraction extends into the window interior
- Large values (21-30) - Refraction affects most of the window area
Automatic Clamping
The edge size is automatically clamped to not exceed half the window’s width or height. This prevents the refraction zones from overlapping in small windows.The internal scaling factor of 10.0 means setting the slider to 20 creates a 200-pixel refraction zone from each edge.
Normal Power (Falloff)
Controls how the refraction intensity falls off from the edge toward the center.- Range: 2 to 22
- Default: 2
- Slider labels: Linear → Round
- Internal scaling: Range value × 0.5
Effect
- Low values (2-6) - Linear falloff, uniform intensity across edge zone
- Medium values (7-15) - Smooth curve, gradual transition
- High values (16-22) - Sharp round falloff, effect concentrated at edges
Usage Tips
- Use low values (2-5) for even, consistent distortion
- Use medium values (6-12) for natural glass appearance
- Use high values (15+) for concentrated edge effects
Refraction Corner Radius
Controls the corner roundness of the refraction effect itself (not the window blur region).- Range: 0 to 200 pixels
- Default: 8
- Slider labels: Square → Round
- Step snapping: Snapped to ~6.67 pixel steps (30 total steps)
Effect
This determines the shape of the refraction boundary:- 0 - Sharp rectangular corners for the refraction zone
- 8-12 - Slight rounding, matches typical window corners
- 20+ - Very rounded corners, softer appearance
- 100+ - Extreme rounding, nearly circular effect
This is separate from the main Corner Radius setting. The main setting affects the blur region clipping, while this setting affects the refraction distortion boundaries.
RGB Fringing Effect
Simulates chromatic aberration - the separation of colors that occurs in real glass due to different refractive indices for different wavelengths.- Range: 0 to 30
- Default: 1
- Slider labels: Off → Strong
- Normalized range: 0.0-1.0 (divided by 30.0)
Effect
- 0 - No color separation, unified distortion
- 1-10 - Subtle color fringing, realistic glass effect
- 11-20 - Noticeable RGB separation at edges
- 21-30 - Extreme chromatic aberration, artistic effect
Visual Description
At window edges, instead of clean distortion, you’ll see:- Red shifted slightly in one direction
- Blue shifted slightly in the opposite direction
- Green in the middle
Texture Repeat Modes
Controls how the distortion behaves at the absolute edges of the blurred background texture.Clamp (Extend Edge Pixels)
The edge pixels of the background are extended infinitely. When the refraction tries to sample beyond the texture boundary, it receives the color of the edge pixel.- Effect: Clean, solid color at extreme distortion
- Best for: Strong refraction with clean edges
- Mode value: 0
Flip (Mirror Texture)
The background texture is mirrored at the boundaries. When the refraction samples beyond the edge, it receives the mirrored texture.- Effect: Continuous pattern, no hard edges
- Best for: Seamless, natural distortion
- Mode value: 1
This setting primarily affects behavior at very high refraction strengths. At moderate strengths, the difference is subtle or invisible.
Refraction vs. Contrast Pass
Refraction is an alternative to the brightness/saturation/contrast adjustments, not an addition.When Refraction is Disabled (Strength = 0)
- Standard contrast pass is used
- Brightness, saturation, and contrast settings apply
- No distortion, only color/brightness adjustments
When Refraction is Enabled (Strength > 0)
- Refraction shader replaces contrast pass
- Brightness, saturation, and contrast settings are ignored
- Distortion effect applied instead
Technical Implementation
Refraction is implemented using custom fragment shaders:refraction.frag- Rectangular windowsrefraction_rounded.frag- Windows with rounded corners
- Calculate distance from each pixel to the nearest window edge
- Apply the normal power falloff curve
- Distort the background texture coordinates based on strength and mode
- Apply RGB fringing by offsetting color channels
- Sample the blurred background texture at the distorted coordinates
- Handle edge cases using the selected texture repeat mode
Performance Considerations
Refraction is more GPU-intensive than the standard contrast pass because:- Multiple texture samples per pixel (for RGB fringing)
- Complex distance field calculations
- Non-linear coordinate transformations
- Slightly reduced frame rates with many windows
- Increased GPU temperature under load
If you experience performance issues, reduce refraction strength or edge size, or disable RGB fringing to reduce shader complexity.
Version History
- Version 1.x (Original Better Blur) - Refraction included
- Version 2.0.0 - Refraction removed (breaking change) due to incompatibility with Plasma 6.5 blur architecture
- Version 2.2.0 - Refraction re-implemented for Plasma 6.6 blur system
The re-implemented refraction in 2.2.0 is built on the new Plasma 6.6 blur infrastructure and is not a direct port of the old implementation. Some visual characteristics may differ from the original.