/////////////////////////
// Copyright 2007-2008 Google Inc. All Rights Reserved.
/////////////////////////

/////////////////////////
// Shader constants (i.e. constant registers).
/////////////////////////
[modelView_VS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementSize, _vectorWidth
_name.value = matrix.modelview
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// Matrices are composed of four vectors.
_elementSize.value = 4
// Each vector in the matrix has four elements.
_vectorWidth.value = 4
const = false

[modelViewProj_VS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementSize, _vectorWidth
_name.value = matrix.mvp
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// Matrices are composed of four vectors.
_elementSize.value = 4
// Each vector in the matrix has four elements.
_vectorWidth.value = 4
const = false

[textureMatrix_VS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementSize, _vectorWidth
_name.value = matrix.texture
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// Matrices are composed of four vectors.
_elementSize.value = 4
// Each vector in the matrix has four elements.
_vectorWidth.value = 4
const = false

// World origin in view coordinates.
[worldOriginInView_VS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementIndex, _elementSize,\
  _vectorWidth
_name.value = generic.vectors.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// The element index is an identifier that allows us to modify this attribute
// during run-time.
_elementIndex.value = 10
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

// Camera to sun direction in view coordinate system.
[cameraToSunDirAndExposure_VS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementIndex, _elementSize,\
  _vectorWidth
_name.value = generic.vectors.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// The element index is an identifier that allows us to modify this attribute
// during run-time.
_elementIndex.value = 14
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

// Camera to sun direction in view coordinate system.
[cameraToSunDirAndExposure_PS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementIndex, _elementSize,\
  _vectorWidth
_name.value = generic.vectors.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// The element index is an identifier that allows us to modify this attribute
// during run-time.
_elementIndex.value = 14
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

// Sun light direction in model space.
[lightDirectionInModel_VS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementIndex, _modifiers,\
  _elementSize, _vectorWidth
_name.value = generic.vectors.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// The element index is an identifier that allows us to modify this attribute
// during run-time.
//
// Use the same element index as the Camera-to-Sun direction, and
// transform the direction using the modifiers list below.
_elementIndex.value = 14
// Let:
//   Lm = light direction in model space
//   Lv = light direction in view space
//   CSv = direction from camera to sun in view space
//   MV = model-view rotation.
// Then:
//   Lv = normalize(Lm * MV)  (row vectors)
//   Lm = normalize(Lv * inverse(MV))
//   Lm = normalize(CSv * inverse(MV))  (since Lv = -CSv)
_modifiers.value = IG_GFX_STATE_MODIFIER_XFORM44_INVERTED_MODELVIEW,\
                   IG_GFX_STATE_MODIFIER_NORMALIZE3
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

// xyz: Attribute for Mie color corresponding to the brightest spot in the
//      sky (i.e. usually the sun's front color during the day, and black
//      during the night).
//      This is computed on the CPU in double floating precision to avoid
//      precision problems on the GPU.
// w: Sun strength: [0, 1] where 0 = no sun, 1 = full strength.
[brightestMieColorAndSunStrength_PS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementIndex, _elementSize,\
  _vectorWidth
_name.value = generic.vectors.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// The element index is an identifier that allows us to modify this attribute
// during run-time.
_elementIndex.value = 11
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

 // Format of atmosphereCustomState:
 //   x = {0, 1} depending on lighting state
 //   y = {0, 1} depending on texture stage zero state
 //   z = 0
 //   w = 0
[atmosphereCustomState_VS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementSize, _vectorWidth
_name.value = atmosphere.custom.state.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

 // Format of atmosphereCustomState:
 //   x = {0, 1} depending on lighting state
 //   y = {0, 1} depending on texture stage zero state
 //   z = 0
 //   w = 0
[atmosphereCustomState_PS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementSize, _vectorWidth
_name.value = atmosphere.custom.state.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

// Camera Light Info
[cameraLightInfo_VS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementIndex, _elementSize,\
  _vectorWidth
_name.value = generic.vectors.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// The element index is an identifier that allows us to modify this attribute
// during run-time.
_elementIndex.value = 15
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

// Diffuse color
[atmosphereCustomColor_PS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementSize, _vectorWidth
_name.value = atmosphere.custom.color.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

// Startup Constants for Scattering
[startupConsts_VS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementIndex, _elementSize,\
  _vectorWidth
_name.value = generic.vectors.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// The element index is an identifier that allows us to modify this attribute
// during run-time.
_elementIndex.value = 16
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

// xyz: Extra ambient color that is stronger during sunsets (and sunrises).
// w: density used in fog exp2 function.
[sunsetAmbientAndFogDensity_VS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementIndex, _elementSize,\
  _vectorWidth
_name.value = generic.vectors.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// The element index is an identifier that allows us to modify this attribute
// during run-time.
_elementIndex.value = 17
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

[fogColor_PS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementIndex, _elementSize,\
  _vectorWidth
_name.value = generic.vectors.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// The element index is an identifier that allows us to modify this attribute
// during run-time.
_elementIndex.value = 18
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

// Sky vertex parameters for when sun mode is disabled.
[skySunOffVertexParams_VS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementIndex, _elementSize, _vectorWidth
_name.value = generic.vectors.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// The element index is an identifier that allows us to modify this attribute
// during run-time.
_elementIndex.value = 19
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

// Sky pixel parameters for when sun mode is disabled.
//    x: Sky map's texture lookup's s-coordinate dependent on view height.
[skySunOffPixelParams_PS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementIndex, _elementSize, _vectorWidth
_name.value = generic.vectors.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// The element index is an identifier that allows us to modify this attribute
// during run-time.
_elementIndex.value = 20
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

// Ground vertex parameters for when sun mode is disabled.
[groundSunOffVertexParams_VS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementIndex, _elementSize, _vectorWidth
_name.value = generic.vectors.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// The element index is an identifier that allows us to modify this attribute
// during run-time.
_elementIndex.value = 21
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

// Ground pixel parameters for when sun mode is disabled.
//    x: Ground map's texture lookup's s-coordinate dependent on view height.
[groundSunOffPixelParams_PS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementIndex, _elementSize, _vectorWidth
_name.value = generic.vectors.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// The element index is an identifier that allows us to modify this attribute
// during run-time.
_elementIndex.value = 22
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

// xyz: fog color.
[groundFogColor_PS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementIndex, _elementSize,\
  _vectorWidth
_name.value = generic.vectors.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// The element index is an identifier that allows us to modify this attribute
// during run-time.
_elementIndex.value = 23
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

[dirToCameraAndFogDensity_VS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementIndex, _elementSize,\
  _vectorWidth
_name.value = generic.vectors.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// The element index is an identifier that allows us to modify this attribute
// during run-time.
_elementIndex.value = 24
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

// This defines a vector shader parameter, the first two elements of which
// contain the top right edge of an image in a texture, in normalized S and T
// coordinates.
[groundOverlayExtent_PS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementIndex, _elementSize, _vectorWidth
_name.value = generic.vectors.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// The element index is an identifier that allows us to modify this attribute
// during run-time.
_elementIndex.value = 34
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

// This is the color used to render a ground overlay in the pixel shader.
[groundOverlayColor_PS]
type = igGfxShaderConstant
fields = _name, _baseRegister, _elementIndex, _elementSize, _vectorWidth
_name.value = generic.vectors.value
// The base registry depends on the shader source code, which
// depends on the target configuration. Therefore, _baseRegister
// is overwritten inside the .cfg file.
_baseRegister.value = -1
// The element index is an identifier that allows us to modify this attribute
// during run-time.
_elementIndex.value = 35
// Single vector.
_elementSize.value = 1
// Vector with four elements.
_vectorWidth.value = 4
const = false

/////////////////////////
// Shader samplers.
/////////////////////////
[groundTexture_PS]
fields = _name, _samplerNumber, _textureUnit
type=igTextureSamplerSource
_name.value=groundTexture
// The sampler number depends on the shader source code, which
// depends on the target configuration. Therefore, it
// is overwritten inside the .cfg file.
_samplerNumber.value = -1
// User texture stage number.
_textureUnit.value=0
const = false

[groundRayleighMap_PS]
fields = _name, _samplerNumber, _textureUnit
type=igTextureSamplerSource
_name.value=groundRayleighMap
// The sampler number depends on the shader source code, which
// depends on the target configuration. Therefore, it
// is overwritten inside the .cfg file.
_samplerNumber.value = -1
// User texture stage number.
_textureUnit.value=1
const = false

[skyMap_PS]
fields = _name, _samplerNumber, _textureUnit
type=igTextureSamplerSource
_name.value=skyMap
// The sampler number depends on the shader source code, which
// depends on the target configuration. Therefore, it
// is overwritten inside the .cfg file.
_samplerNumber.value = -1
// User texture stage number.
_textureUnit.value=0
const = false

