Skip to content

Commit

Permalink
Add custom tonemapping
Browse files Browse the repository at this point in the history
  • Loading branch information
whatdahopper committed Mar 6, 2023
1 parent 34f4255 commit de67532
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions CustomTonemapping.cginc
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit de67532

Please sign in to comment.