//
// 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. A bit personal.
const float gammaFactor=1.25;

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

// Z correction for cameras (to avoid acne)
//const float smCor[SM_MAX_SPLITS]=  { 0.000017,0.000065,0.00025,0.001 };     // For 1830, profile0 (splitdist0=10)
//const float smCor[SM_MAX_SPLITS]=  { 0.00004,0.00017,0.00055,0.001 };     // For 1830
const float smCor[SM_MAX_SPLITS]=  { 0.0012,0.005,0.0075,0.028 };     // For 1830
//const float smCor[SM_MAX_SPLITS]=  { -0.1,-0.1,-0.1,-0.1};     // For 1830
//const float smCor[SM_MAX_SPLITS]=  { 0.00004,0.000065,0.00025,0.001 };     // For 1830

// 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 )
};
