#ifndef _ENBINTERNALS_FXH_
#define _ENBINTERNALS_FXH_
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//  enbInternals helper header by kingeric1992
//                                              Nov.4.2017
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// helper constants
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


#define LUM_COEFF   float3(0.299,0.587,0.114)
#define NULL        0
#define DELTA       1.0e-10
#define XM_PI       3.1415926535898

#define F3_ZERO     float(0.0).xxx
#define F3_ONE      float(1.0).xxx
#define F4_ZERO     float(0.0).xxxx
#define F4_ONE      float(1.0).xxxx

#define UI_DISABLE static const
#define UI_ENABLE

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// specific params for each file
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#ifdef ENBINTERNALS_POSTPASS
Texture2D TextureOriginal;  //color R10B10G10A2 32 bit ldr format
Texture2D TextureColor;     //color which is output of previous technique (except when drawed to temporary render target), R10B10G10A2 32 bit ldr format
Texture2D TextureDepth;     //scene depth R32F 32 bit hdr format
#endif

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// shared params
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

float4 Timer;           //x = [0,1]timer, map to 16777216 ms (4.6 hours), y = average fps, w = frame time elapsed (in seconds)
float4 ScreenSize;      //x = Width, y = 1/Width, z = Width/Height, w = Height/Width
float  AdaptiveQuality; //changes in range 0..1, 0 means full quality, 1 lowest dynamic quality (0.33, 0.66 are limits for quality levels)
float4 Weather;         //x = current weather index, y = outgoing weather index (0 if non indexed), z = weather transition, w = time of the day in 24 standart hours.
float4 TimeOfDay1;      //x = dawn, y = sunrise, z = day, w = sunset. Interpolators range from 0..1
float4 TimeOfDay2;      //x = dusk, y = night. Interpolators range from 0..1
float  ENightDayFactor; //changes in range 0..1, 0 means that night time, 1 - day time
float  EInteriorFactor; //changes 0 or 1. 0 means that exterior, 1 - interior

//keyboard controlled temporary variables. Press and hold key 1,2,3...8 together with PageUp or PageDown to modify. By default all set to 1.0
float4 tempF1;          //1,2,3,4
float4 tempF2;          //5,6,7,8
float4 tempF3;          //9,0

//0 = none, 1 = left, 2 = right, 3 = left+right, 4 = middle, 5 = left+middle, 6 = right+middle, 7 = left+right+middle (or rather cat is sitting on your mouse)
float4 tempInfo1;       //xy = cursor position in range 0..1 of screen, z  = is shader editor window active, w  = mouse buttons with values 0..7 as above
float4 tempInfo2;       //xy = previous left click pos, zw = previous right click pos.

//temporary textures which can be set as render target for techniques via annotations like <string RenderTarget="RenderTargetRGBA32";>
Texture2D RenderTargetRGBA32;   //R8G8B8A8 32 bit ldr format
Texture2D RenderTargetRGBA64;   //R16B16G16A16 64 bit ldr format
Texture2D RenderTargetRGBA64F;  //R16B16G16A16F 64 bit hdr format
Texture2D RenderTargetR16F;     //R16F 16 bit hdr format with red channel only
Texture2D RenderTargetR32F;     //R32F 32 bit hdr format with red channel only
Texture2D RenderTargetRGB32F;   //32 bit hdr format without alpha

SamplerState SamplerPoint  { Filter = MIN_MAG_MIP_POINT;  AddressU = Border; AddressV = Border; };
SamplerState SamplerLinear { Filter = MIN_MAG_MIP_LINEAR; AddressU = Border; AddressV = Border; };
#endif //_ENBINTERNALS_FXH_