Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
DMD3502-Cutscene-JacobTomassi/Cutscene/Assets/LowpolySimpleHouse/PostProcessing/Resources/Shaders/EyeAdaptation.cginc
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
22 lines (18 sloc)
695 Bytes
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
#ifndef __EYE_ADAPTATION__ | |
#define __EYE_ADAPTATION__ | |
// Optimal values for PS4/GCN | |
// Using a group size of 32x32 seems to be a bit faster on Kepler/Maxwell | |
// Don't forget to update 'EyeAdaptationController.cs' if you change these values ! | |
#define HISTOGRAM_BINS 64 | |
#define HISTOGRAM_TEXELS HISTOGRAM_BINS / 4 | |
#define HISTOGRAM_THREAD_X 16 | |
#define HISTOGRAM_THREAD_Y 16 | |
float GetHistogramBinFromLuminance(float value, float2 scaleOffset) | |
{ | |
return saturate(log2(value) * scaleOffset.x + scaleOffset.y); | |
} | |
float GetLuminanceFromHistogramBin(float bin, float2 scaleOffset) | |
{ | |
return exp2((bin - scaleOffset.y) / scaleOffset.x); | |
} | |
#endif // __EYE_ADAPTATION__ |