-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34f4255
commit de67532
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |