Back to Blog

automation

Handling SDR Tonemap and LUTs in Game Shaders

Learn how the handle-sdr-tonemap-lut skill helps AI agents edit game shaders for accurate SDR-to-HDR conversion.

OpenAgentSkillPublished:

Where this fits

You're modding a game to add HDR output using RenoDX. The game's shaders end with a hard-clipped SDR tonemap and a LUT that crushes highlights. You need to replace that pipeline with a neutral-by-default ToneMapPass, preserve the vanilla look, and bridge into HDR without breaking the game's color grading. This skill gives your agent the exact steps to locate the right color signals, apply proven tonemap curves, and manage LUTs shader-side.

Why agents benefit

  • Identifies the correct upstream HDR/SDR signal in HLSL or Slang code, avoiding guesswork about where to insert changes.
  • Applies proven tonemap implementations (RenoDRT, PsychoV17, vanilla midgray matching) directly in shader code, not as a post-process hack.
  • Handles LUT bridges: detects when a game uses an internal LUT and replaces or bypasses it without losing the original artistic intent.
  • Validates "Preset Off" behavior to ensure vanilla appearance is exactly preserved when the user disables tweaks.
  • Reduces iteration time by providing a checklist of common failure points (hard clips, gamut compression, hue/saturation emulation).

Practical scenarios

Auditing a LUT bridge

The game applies a 3D LUT after tonemapping. Your agent needs to verify whether the LUT is applied in linear or gamma space, and whether it should be kept or bypassed for HDR. The skill walks through the bridge logic and suggests a replacement shader-side LUT that maintains the look without clipping.

Adding PsychoV17 tone mapping

You want to replace the game's default tonemap with PsychoV17 for better highlight rolloff. The skill provides the exact shader code changes, including how to set the neutral midgray and slope parameters to match the vanilla response, so the HDR output doesn't look washed out or too contrasty.

Fixing a hard-clip ToneMapPass

The game's tone map clamps values at 1.0, losing HDR detail. Your agent needs to insert a RenoDRT pass that maps to a wider range. The skill explains where to hook in, how to preserve the original color grading, and how to test with a reference HDR monitor.

Add it to your agent workflow

Install the skill via:

npx skills add clshortfuse/renodx --skill handle-sdr-tonemap-lut

Then invoke it with a goal like:

Audit the LUT bridge in `post.fx` and replace it with a neutral LUT that preserves the vanilla SDR look for HDR output.

The agent will parse the shader, identify the tonemap and LUT stages, and apply the recommended changes.

Compare before adopting

Evaluate this skill against other approaches: a naive inverse-tonemap postprocess (like AutoHDR) is easier but loses fidelity. Compare quality signals: does the skill's output preserve the original game's midgray and color balance? Also check maintenance freshness—RenoDX is actively updated (3.7k stars). Alternatives include custom shader patches or full replacement pipelines; this skill focuses on the minimal shader-side changes that are proven to work.

Why it is worth tracking

RenoDX has a strong community and a track record of working across many games. This skill codifies the most common shader-side tonemap and LUT operations, making it a reliable reference for agents. If you're building tools that assist game modders, this skill is a must-have for HDR-related tasks. Revisit it when new tonemap curves or LUT techniques are added. For a deeper look, see the skill page.

Featured Skill

handle-sdr-tonemap-lut

Skill by clshortfuse