#ifndef _SEPIA_FXH_
#define _SEPIA_FXH_
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//  Sepia by Christian Cann Schuldt Jensen ~ CeeJay.dk 
//
//                                      Implemented by kingeric1992 Nov.4.2017
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

struct SepiaStruct {
    bool  State;
    float Weight;
    float sepiaPower, greyPower;
    float3 Tone; // [0, 1]
};

float3 Sepia( float3 col, SepiaStruct IN)
{
    if(!IN.State) return col;
    float3 blend2 = dot(col, LUM_COEFF) * IN.greyPower + (col / (IN.greyPower + 1.0));
	return lerp(blend2, col * IN.Tone, IN.sepiaPower); 	// returning the final color
}

#endif //_SEPIA_FXH_