//
// constants.cg
// 03-12-2009: Created
// All constants that are being used in shaders should be defined in here
//

// Edge blending
const float EDGEBLEND_WIDTH=256.0f;           // Edge blend region (fade to black)
const float EDGEBLEND_SMALL_WIDTH=64.0f;
const float EDGEBLEND_RESWIDTH=1024.0f;       // Resolution

// Bloom amount
const float bloomFactor=1.0;

// Gamma adjustment for some tonemappers (check hdr.cg)
// Values >1 make the image more contrasty, <1 is less contrast
const float gamma=1.0;

// Shadow mapping
#define SM_MAX_SPLITS 4
#define PCF_NUM_SAMPLES 16
const float shadowMapSize=2048.0f;          // Should be the same as in racer.ini was 512
const int iSqrtSamples = 4;					//sample quality, should be 2,4,6...etc 2 or 4 is recommended was 2

const float smBlurAmount=0.0f/1024.0f;			// Amount of shadowmap texture blur (resolution dependent)
// smCor for trackcams
//const float smCor[SM_MAX_SPLITS]={ 0.0004,0.004,0.008,0.003 };  // original
//const float smCor[SM_MAX_SPLITS]={ 0.00005,0.0006,0.003,0.003 };
//const float smCor[SM_MAX_SPLITS]={ 0.0002,0.0003,0.0008,0.003 };
const float smCor[SM_MAX_SPLITS]={ 0.00007,0.0001,0.0005,0.003 };   // best


// blur filter kernel radius for PCF
//const float filterRadiusUV=2.0f/1024f;

// PCF samples for each split of sd map, max=16
//const int PCFSamples[SM_MAX_SPLITS]={16,8,4,1};

// Fake penumbra coefficient, 1= uniform blur, >1= scale the blur along the light direction
//const float penumbraCoe = 4.0f;

// 16 tap poisson disk distribution
const float2 poissonDisk[16]=
{
  float2( -0.94201624, -0.39906216 ),
  float2( 0.94558609, -0.76890725 ),
  float2( -0.094184101, -0.92938870 ),
  float2( 0.34495938, 0.29387760 ),
  float2( -0.91588581, 0.45771432 ),
  float2( -0.81544232, -0.87912464 ),
  float2( -0.38277543, 0.27676845 ),
  float2( 0.97484398, 0.75648379 ),
  float2( 0.44323325, -0.97511554 ),
  float2( 0.53742981, -0.47373420 ),
  float2( -0.26496911, -0.41893023 ),
  float2( 0.79197514, 0.19090188 ),
  float2( -0.24188840, 0.99706507 ),
  float2( -0.81409955, 0.91437590 ),
  float2( 0.19984126, 0.78641367 ),
  float2( 0.14383161, -0.14100790 )
};
