Skip to content

Instantly share code, notes, and snippets.

View nxrighthere's full-sized avatar

Stanislav Denisov nxrighthere

View GitHub Profile
@nxrighthere
nxrighthere / Unreal-AgX-Tonemapper.usf
Last active September 10, 2024 14:53
AgX tonemapping for Unreal Engine 5
// See image comparison https://imgur.com/a/9L2P7GJ
// Read details https://iolite-engine.com/blog_posts/minimal_agx_implementation
// Usage:
// 1. Open "Project Settings" and change "Working Color Space" to "sRGB / Rec709"
// 2. Open `Engine\Shaders\Private\PostProcessTonemap.usf` file
// 3. Find `half3 OutDeviceColor = ColorLookupTable(FinalLinearColor);` line
// 4. Replace it with `half3 OutDeviceColor = ApplyAgX(FinalLinearColor);` line
// 5. Find `half3 ColorLookupTable( half3 LinearColor )` function
// 6. After the scope of the function, add the code below and run `RecompileShaders Changed` from console