From de6753203610e21eb1b3c8b6cb49b122f0f9ff45 Mon Sep 17 00:00:00 2001 From: kaitlyn~ Date: Mon, 6 Mar 2023 15:21:17 -0500 Subject: [PATCH] Add custom tonemapping --- CustomTonemapping.cginc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 CustomTonemapping.cginc diff --git a/CustomTonemapping.cginc b/CustomTonemapping.cginc new file mode 100644 index 0000000..8cf3b63 --- /dev/null +++ b/CustomTonemapping.cginc @@ -0,0 +1,22 @@ +#ifndef CUSTOM_TONEMAPPING_CG_INCLUDED +#define CUSTOM_TONEMAPPING_CG_INCLUDED + +// #pragma multi_compile __ ACES_TONE_MAPPING + +#if ACES_TONE_MAPPING + +// frag: ACES_TONE_MAPPING_APPLY(col); +#define ACES_TONE_MAPPING_APPLY(col) \ + float3 shoulderLinearCol = col.rgb * 2.50999999 + 0.0299999993; \ + shoulderLinearCol = col.rgb * shoulderLinearCol; \ + float3 linearToeCol = col.rgb * 2.43000007 + 0.589999974; \ + linearToeCol = col.rgb * linearToeCol + 0.140000001; \ + col.rgb = clamp(shoulderLinearCol / linearToeCol, 0, 1) + +#else + +#define ACES_TONE_MAPPING_APPLY(col) + +#endif + +#endif // CUSTOM_TONEMAPPING_CG_INCLUDED