RimWorld

RimWorld

103 ratings
AntiAliasing
2
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.4, 1.5, 1.6
File Size
Posted
Updated
1.136 MB
Feb 1 @ 11:58am
Sep 3 @ 5:27pm
6 Change Notes ( view )

Subscribe to download
AntiAliasing

In 1 collection by remi
Mods by Remi
3 items
Description
Anti-Aliasing
Adds modern anti-aliasing and sharpening to RimWorld. Smooths jagged edges on sprites and terrain. Anti-aliasing runs on the GPU after the simulation, so it has no impact on TPS. Works with any texture or graphics feature.

Features
  • FXAA: Fast Approximate Anti-Aliasing. The cheapest option.
  • SMAA: Subpixel Morphological Anti-Aliasing. Sharp, clean edges; a faithful port of the reference implementation. Recommended.
  • SSAA: Supersampling (1.5x / 2x / 4x). The highest quality - antialiases textures too, not just edges. The heaviest option.
  • CAS RGB & Luma: Contrast Adaptive Sharpening, applied after AA to restore detail.
  • Quality presets + Advanced Settings: A simple quality picker per method, with an Advanced toggle for fine-grained controls.
  • Negligible CPU overhead: Processing happens on the GPU after rendering, with no effect on TPS.
  • Compatibility: Compatible with graphics and texture mods. The UI is unaffected and stays crisp.

Performance
FXAA, SMAA and CAS are post-process passes:
Game renders scene → source RT → OnRenderImage → AA blit(s) → destination RT → Present

Each method costs:

- FXAA: 1 blit
- SMAA: 3 blits (edge detection → blending weights → neighborhood blend)
- CAS (RGB/Luma): 1 blit (added after AA if enabled)

SSAA is different: it renders the world at a higher resolution and downsamples back to your screen, so its cost scales with the pixel count - 2x renders 4x the pixels, 4x renders 16x. It is fill-rate bound rather than a fixed number of blits, and is the most demanding option.

The post-process methods are cheap for sprite-based 2D rendering like RimWorld, and modern GPUs handle full-screen blits efficiently. As with anything graphics related the cost is not free - any extra pass reduces FPS. SSAA especially can be heavy at 4x. Please test and report your findings if you have substantial (or noticeable) performance loss.

Requirements
  • Harmony

Supported Languages
All

Supported Versions
1.4, 1.5, 1.6

Mods by Remi Workshop Collection

Technical Notes

FXAA - Fast Approximate Anti-Aliasing
FXAA works by detecting edges based on luminance (brightness) contrast, then blurring along those edges.

How FXAA sees your screen: Before: Edge Detection: After: ┌─────────┐ ┌─────────┐ ┌─────────┐ │▓▓▓▓░░░░░│ │ ││││ │ │▓▓▓▒░░░░░│ │▓▓▓▓░░░░░│ → │ ││││ │ → │▓▓▓▒▒░░░░│ │▓▓▓▓░░░░░│ │ ││││ │ │▓▓▓▒▒░░░░│ └─────────┘ └─────────┘ └─────────┘ Hard edge "Found it!" Smoothed

Technical Details:
• Samples a 5x5 neighborhood to compute local contrast
• Determines edge orientation (horizontal vs vertical)
• Walks along the edge up to 6 pixels to find endpoints
• Blends pixels perpendicular to the edge direction
• Single pass, extremely GPU-friendly

Best for: Lower-end hardware, maximum performance

SMAA - Subpixel Morphological Anti-Aliasing
SMAA recognizes patterns. It detects the morphological shape of each aliased edge and reconstructs the smooth line it was meant to represent, using precomputed lookup tables for accurate, sharp results with minimal blur.
Pattern reconstruction: Aliased edge: Detected span: Reconstructed: ▓▓▓░░░ ▓▓▓\░░ ▓▓▓▒░░ ▓▓░░░░ → ▓▓\░░░ → ▓▓▒░░░ ▓░░░░░ ▓\░░░░ ▓▒░░░░ staircase diagonal smooth slope

Technical Details:
• Pass 1: color-based edge detection
• Pass 2: blending-weight calculation using precomputed AreaTex / SearchTex lookup tables
• Pass 3: neighborhood blending
• A faithful 1:1 port of the reference shader (matches Unity's Post-Processing v2), High preset by default
• Low / Medium / High quality controls search steps and diagonal/corner detection
• Edge threshold is adjustable under Advanced Settings

Best for: Sharp, clean edges with minimal blur. Recommended for most users.

SSAA - Supersampling Anti-Aliasing
SSAA is brute force, and the highest quality. It renders the world at a higher resolution and shrinks it back down, averaging multiple samples into every final pixel. Because it has more real samples to work with, it is the only method that smooths the inside of textures, not just detected edges.
SSAA (2x example): Render at 2x resolution: Downsample to screen: ┌───────────────┐ │ ▓▓▓▓▓▒▒░░░░░░░ │ ┌───────┐ │ ▓▓▓▓▓▒▒░░░░░░░ │ → │ ▓▓▒░░░ │ │ ▓▓▓▓▒▒▒░░░░░░░ │ │ ▓▓▒░░░ │ └───────────────┘ └───────┘ 4x the pixels averaged = smooth

Technical Details:
• Renders the world camera into a 1.5x / 2x / 4x render target
• Downsamples back to native resolution with an iterative box filter
• Antialiases texture interiors, thin features, and in-world text - not just edges
• The UI is rendered separately and stays at native resolution (crisp)
• Mathematically exact; cost scales with the square of the scale factor

Best for: Maximum quality on capable GPUs.

CAS - Contrast Adaptive Sharpening
CAS restores detail that anti-aliasing may soften. Unlike basic sharpening, it adapts to local contrast to avoid amplifying noise or creating halos. Apply it after AA. With SSAA it is fused into the downsample for free.
Traditional Sharpen vs CAS: Original: Basic Sharpen: CAS: ░░▓▓▓░░ ░░▓▓▓░░ ░░▓▓▓░░ ░░▓▓▓░░ → ░▒▓▓▓▒░ vs ░░▓▓▓░░ ░░▓▓▓░░ ░░▓▓▓░░ ░░▓▓▓░░ ↑halos↑ no artifacts

Two Modes:
CAS (RGB) - Sharpens all color channels independently
• Maximum detail enhancement
• Best for most content

CAS (Luma) - Sharpens brightness only, preserves colors
• Prevents color fringing on high-contrast edges
• Better for pixel art or stylized graphics

References

FXAA - Timothy Lottes, "FXAA" (NVIDIA, 2009)

SMAA - Jimenez, Echevarria, Sousa, Gutierrez, "SMAA: Enhanced Subpixel Morphological Antialiasing" (Computer Graphics Forum, 2012)

SSAA - Ordered-grid supersampling. Franklin Crow, "The Aliasing Problem in Computer-Generated Shaded Images" (CACM 20(11), 1977)

CAS - AMD FidelityFX Contrast Adaptive Sharpening (Timothy Lottes, AMD)
53 Comments
remi  [author]
Sep 4 @ 7:59am 
Thanks for the kind words! I don't plan on halting development on any of my mods unless they are officially implemented in base Rimworld!

(I prefer CAS Luma, but it depends what AA setting you are using and what camera zoom levels you use!)
Sep 4 @ 6:00am 
Also between CAS RGB and CAS Luma, what is your preferred?
Sep 4 @ 5:59am 
Please don't stop developing this mod. It's starting to catch fire. :D
Sep 4 @ 12:43am 
Thanks for the speedy update, remi! I like your Steam avatar, by the way.
remi  [author]
Sep 3 @ 5:29pm 
New Update:
Optimized SSAA massively! (2-5x times depending on settings). Fixed color correction order of operations, no more desaturated colors!

Thanks to @Ezh for reporting the issue! :B1:
remi  [author]
Sep 1 @ 5:51pm 
@Ezh thanks for the kinda words and for providing so much information alongside your comment! I'll look into fixing things up asap.
Sep 1 @ 2:49pm 
This mod is fantastic, particularly the SSAA implementation! I like that it can bring out some fine details on items like weapons. Thanks for your work.

I'm seeing a slight issue in that the SSAA option results in the viewport being desaturated quite starkly, with or without sharpening enabled. This appears to happen with only the DLC, Harmony, and this mod loaded.

https://imgico.com/c/ax8BD48

I found that a render scale of around 2.5 was the furthest I could push it before performance was affected enough to notice, though it was only very apparent during camera movement. Also, it would be wonderful if this could be extended to the world map! The backlit edges of the globe and the borders of highlighted tiles are especially distracting.

Windows 11
Nvidia GeForce RTX 4070 Ti
Driver version 616.56, default settings
3440x1440, 144hz
Aug 30 @ 6:16am 
what the dog doin' ?
Aug 30 @ 5:34am 
This mod has forever changed my perception of how much people can really mod this game
Amazing mod, and the total lack of AI usage is even more amazing
Jul 19 @ 1:27am 
thats a dowg