--
-- Light First pass for Light PrePass Renderer Geometry
--

Global:AddMaterial(
	"SHADER",  "../../Assets/Shaders/lpp/lfSingleTexture",
	1,
	"lfFlat"
)

Global:AddMaterial(
	"UNIFORM", "1 Normal",
	"TEXTURE", "1 ../../Assets/Textures/ground0102bump.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/lfFlatEyeBump",
	3,
	"lfVine"
)

Global:AddMaterial(
	"UNIFORM", "1 Normal",
	"TEXTURE", "1 ../../Assets/Textures/ground0102bump.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/lfFlatEyeBump",
	3,
	"lfMoon"
)

Global:AddMaterial(
	"UNIFORM", "1 Normal",
	"TEXTURE", "1 ../../Assets/Textures/ground0102bump.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/lfFlatEyeBump",
	3,
	"lfDock"
)

Global:AddMaterial(
	"UNIFORM", "0 Normal",
	"TEXTURE", "0 ../../Assets/Textures/ground0102bump.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/lfZoomallax",
	3,
	"lfGroundGrassFirefly"
)

Global:AddMaterial(
	"UNIFORM", "1 Normal",
	"TEXTURE", "1 ../../Assets/Textures/ground0102bump.bmp",
	"UNIFORM", "0 Height",
	"TEXTURE", "0 ../../Assets/Textures/ground0102justbump.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/lfTriPlanarProjectionEyeLightTexture",
	5,
	"lfGround"
)

Global:AddMaterial(
	"UNIFORM", "0 Normal",
	"TEXTURE", "0 ../../Assets/Textures/groundmossbump.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/lfNoGrass",
	3,
	"lfGround1"
)

Global:AddMaterial(
	"UNIFORM", "0 Normal",
	"TEXTURE", "0 ../../Assets/Textures/ground0102bump.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/lfSky",
	3,
	"lfSky"
)

--
-- Geometry After pass for Light PrePass Renderer Geometry
--

Global:AddMaterial(
	"UNIFORM", "0 SceneLight",
	"UNIFORM", "2 Color0",
	"TEXTURE", "2 ../../Assets/Textures/celGreen.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/gaSingleTexture",
	4,
	"gaFlat"
)

Global:AddMaterial(
	"GAMEINFO", "LightAmount",
  "UNIFORM", "0 SceneLight",
	"UNIFORM", "3 Color1",
	"TEXTURE", "3 ../../Assets/Textures/lanternAlphaEmissive.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/gaSingleEmissive",
	5,
	"gaLantern"
)

Global:AddMaterial(
  "UNIFORM", "0 SceneLight",
	"UNIFORM", "3 Color0",
	"TEXTURE", "3 ../../Assets/Textures/aster05.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/gaSingleTexture",
	4,
	"gaAster"
)

Global:AddMaterial(
  "GAMEINFO", "VertexColor",
	"UNIFORM", "0 SceneLight",
	"SHADER",  "../../Assets/Shaders/lpp/gaVine",
	3,
	"gaVine"
)

Global:AddMaterial(
	"UNIFORM", "0 SceneLight",
	"UNIFORM", "1 SceneNormal",
	"UNIFORM", "2 Color0",
	"TEXTURE", "2 ../../Assets/Textures/celCream.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/gaFlatEyeBump",
	5,
	"gaMoon"
)

Global:AddMaterial(
  "UNIFORM", "0 SceneLight",
	"UNIFORM", "3 Color1",
	"TEXTURE", "3 ../../Assets/Textures/dock.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/gaSingleTexture",
	4,
	"gaDock"
)

Global:AddMaterial(
    "UNIFORM", "0 SceneLight",
	"UNIFORM", "1 SceneNormal",
	"UNIFORM", "4 Normal",
	"TEXTURE", "4 ../../Assets/Textures/ground0102bump.bmp",
	"UNIFORM", "3 Color1",
	"TEXTURE", "3 ../../Assets/Textures/spot.bmp",
	"UNIFORM", "2 Color0",
	"TEXTURE", "2 ../../Assets/Textures/celCream.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/gaZoomallax",
	9,
	"gaGroundGrass"
)

Global:AddMaterial(
	"UNIFORM", "0 SceneLight",
	"UNIFORM", "1 SceneNormal",
	"UNIFORM", "4 Normal",
	"TEXTURE", "4 ../../Assets/Textures/ground0102bump.bmp",
	"UNIFORM", "3 Color1",
	"TEXTURE", "3 ../../Assets/Textures/waterWaves.bmp",
	"UNIFORM", "2 Color0",
	"TEXTURE", "2 ../../Assets/Textures/celRed.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/gaZoomallax",
	9,
	"gaFirefly"
)

Global:AddMaterial(
  "GAMEINFO", "GrassColorScale",
  "GAMEINFO", "GrassColorBias",
	"UNIFORM",  "0 SceneLight",
  "UNIFORM",  "1 SceneNormal",
  "UNIFORM",  "4 Height",
	"TEXTURE",  "4 ../../Assets/Textures/ground0102justbump.bmp",
	"UNIFORM",  "3 Color1",
	"TEXTURE",  "3 ../../Assets/Textures/cavemoss.bmp",
	"UNIFORM",  "2 Color0",
	"TEXTURE",  "2 ../../Assets/Textures/celGreen.bmp",
	"SHADER",   "../../Assets/Shaders/lpp/gaTriPlanarProjectionEyeLightTexture",
	11,
	"gaGround"
)

Global:AddMaterial(
  "UNIFORM", "0 SceneLight",
  "UNIFORM", "1 SceneNormal",
	"UNIFORM", "4 Height",
	"TEXTURE", "4 ../../Assets/Textures/ground0102justbump.bmp",
	"UNIFORM", "3 Color1",
	"TEXTURE", "3 ../../Assets/Textures/cavemoss.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/gaTriPlanarProjectionEyeLightTexture0NoGrass",
	7,
	"gaGround1"
)

Global:AddMaterial(
    "UNIFORM", "0 SceneLight",
    "UNIFORM", "1 SceneNormal",
	"UNIFORM", "4 Height",
	"TEXTURE", "4 ../../Assets/Textures/ground0102justbump.bmp",
	"UNIFORM", "3 Color1",
	"TEXTURE", "3 ../../Assets/Textures/cavemoss.bmp",
	"UNIFORM", "2 Color0",
	"TEXTURE", "2 ../../Assets/Textures/celGreen.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/gaTriPlanarProjectionEyeLightTexture",
	9,
	"gaGround2"
)

Global:AddMaterial(
    "UNIFORM", "0 SceneLight",
    "UNIFORM", "1 SceneNormal",
	"UNIFORM", "4 Height",
	"TEXTURE", "4 ../../Assets/Textures/ground0102justbump.bmp",
	"UNIFORM", "3 Color1",
	"TEXTURE", "3 ../../Assets/Textures/cavemoss.bmp",
	"UNIFORM", "2 Color0",
	"TEXTURE", "2 ../../Assets/Textures/celGreen.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/gaTriPlanarProjectionEyeLightTexture",
	9,
	"gaGround3"
)

Global:AddMaterial(
    "UNIFORM", "0 SceneLight",
    "UNIFORM", "1 SceneNormal",
	"UNIFORM", "4 Height",
	"TEXTURE", "4 ../../Assets/Textures/ground0102justbump.bmp",
	"UNIFORM", "3 Color1",
	"TEXTURE", "3 ../../Assets/Textures/cavemoss.bmp",
	"UNIFORM", "2 Color0",
	"TEXTURE", "2 ../../Assets/Textures/celGreen.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/gaTriPlanarProjectionEyeLightTexture",
	9,
	"gaGround4"
)

Global:AddMaterial(
    "UNIFORM", "0 SceneLight",
    "UNIFORM", "1 SceneNormal",
	"UNIFORM", "4 Height",
	"TEXTURE", "4 ../../Assets/Textures/ground0102justbump.bmp",
	"UNIFORM", "3 Color1",
	"TEXTURE", "3 ../../Assets/Textures/cavemoss.bmp",
	"UNIFORM", "2 Color0",
	"TEXTURE", "2 ../../Assets/Textures/celGreen.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/gaTriPlanarProjectionEyeLightTexture",
	9,
	"gaGround5"
)

Global:AddMaterial(
	"GAMEINFO", "LightHue",
	"UNIFORM", "0 SceneLight",
	"UNIFORM", "1 SceneNormal",
	"UNIFORM", "4 Normal",
	"TEXTURE", "4 ../../Assets/Textures/ground0102bump.bmp",
	"UNIFORM", "3 Color1",
	"TEXTURE", "3 ../../Assets/Textures/paintsky.bmp",
	"UNIFORM", "2 Color0",
	"TEXTURE", "2 ../../Assets/Textures/celCream.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/gaSky",
	10,
	"gaSky"
)

Global:AddMaterial(
    --"GAMEINFO", "SphericalHarmonics",
	"GAMEINFO", "Doublesided",
	"TIMER", "0.02",
	"BLEND", "PreMultipliedAlpha",
	"UNIFORM", "0 SceneLight",
	"UNIFORM", "1 SceneNormal",
	"UNIFORM", "7 SceneColor",
	"UNIFORM", "4 Normal",
	"TEXTURE", "4 ../../Assets/Textures/ground0102bump.bmp",
	"UNIFORM", "3 Color1",
	"TEXTURE", "3 ../../Assets/Textures/ground03.bmp",
	"UNIFORM", "2 Color0",
	"TEXTURE", "2 ../../Assets/Textures/celCream.bmp",
	"SHADER",  "../../Assets/Shaders/lpp/gaBubble",
	13,--14,
	"gaBubble"
)

Global:AddMaterial(
	"BLEND", "PreMultipliedAlpha",
	"GAMEINFO", "UpVector",
	"GAMEINFO", "RightVector",
	"SCALE", "2.0",
	"TEXTURE", "0 ../../Assets/Textures/fireflyHalo.bmp",
	"UNIFORM", "1 Position",
	"UNIFORM", "0 Color0",
	"SHADER",  "../../Assets/Shaders/lpp/gaQuadParticleColor",
	"NODEPTH", "none",
	9,
	"gaFireflyParticle"
)

Global:AddMaterial(
	"BLEND", "PreMultipliedAlpha",
	"GAMEINFO", "UpVector",
	"GAMEINFO", "RightVector",
	"SCALE",   "3.0",
	"TEXTURE", "0 ../../Assets/Textures/fireflyHalo5.bmp",
	"UNIFORM", "1 Position",
	"UNIFORM", "0 Color0",
	"SHADER",  "../../Assets/Shaders/lpp/gaQuadParticle",
	"NODEPTH", "none",
	9,
	"gaBlueFireflyParticle"
)

Global:AddMaterial(
	"BLEND", "PreMultipliedAlpha",
	"GAMEINFO", "UpVector",
	"GAMEINFO", "RightVector",
	"SCALE", "1.0",
	"TEXTURE", "0 ../../Assets/Textures/fireflyHalo3.bmp",
	"UNIFORM", "1 Position",
	"UNIFORM", "0 Color0",
	"SHADER",  "../../Assets/Shaders/lpp/gaQuadParticle",
	"NODEPTH", "none",
	9,
	"gaFireflyGetParticle"
)

Global:AddMaterial(
	"BLEND", "PreMultipliedAlpha",
	"GAMEINFO", "UpVector",
	"GAMEINFO", "RightVector",
	"SCALE", "15.0",
	"TEXTURE", "2 ../../Assets/Textures/fireflyHalo4.bmp",
	"UNIFORM", "2 Color1",
	"UNIFORM", "1 Position",
	"UNIFORM", "0 Color0",
	"SHADER",  "../../Assets/Shaders/lpp/gaLightRay",
	"NODEPTH", "none",
	"GAMEINFO", "NoUpdate",
	11,
	"gaLightRay"
)

Global:AddMaterial(
	"BLEND", "PreMultipliedAlpha",
	"GAMEINFO", "UpVector",
	"GAMEINFO", "RightVector",
	"SCALE", "30.0",
	"TEXTURE", "2 ../../Assets/Textures/fireflyHalo4.bmp",
	"UNIFORM", "2 Color1",
	"UNIFORM", "1 Position",
	"UNIFORM", "0 Color0",
	"SHADER",  "../../Assets/Shaders/lpp/gaLightRaySimple",
	"NODEPTH", "none",
	"GAMEINFO", "NoUpdate",
	11,
	"gaLightRaySimple"
)

Global:AddMaterial(
	"BLEND", "PreMultipliedAlpha",
	"GAMEINFO", "UpVector",
	"GAMEINFO", "RightVector",
	"SCALE", "8.0",
	"TEXTURE", "2 ../../Assets/Textures/fireflyHalo7.bmp",
	"UNIFORM", "2 Color1",
	"UNIFORM", "1 Position",
	"UNIFORM", "0 Color0",
	"SHADER",  "../../Assets/Shaders/lpp/gaLightRayLantern",
	"NODEPTH", "none",
	10,
	"gaLightRayLantern"
)

Global:AddMaterial(
	"BLEND", "PreMultipliedAlpha",
	"GAMEINFO", "UpVector",
	"GAMEINFO", "RightVector",
	"GAMEINFO", "FFRadius",
	"TEXTURE", "0 ../../Assets/Textures/bigRing.bmp",
	"UNIFORM", "0 Color0",
	"SHADER",  "../../Assets/Shaders/lpp/gaRing",
	"NODEPTH", "none",
	8,
	"gaRing"
)

Global:AddMaterial(
	"BLEND", "PreMultipliedAlpha",
	"GAMEINFO", "UpVector",
	"GAMEINFO", "RightVector",
	"GAMEINFO", "LengthAmount",
	"TEXTURE", "0 ../../Assets/Textures/bigRing.bmp",
	"UNIFORM", "0 Color0",
	"SHADER",  "../../Assets/Shaders/lpp/gaRingInner",
	"NODEPTH", "none",
	8,
	"gaRingInner"
)

--
-- Shadowing
--

Global:AddMaterial(
	"SHADER", "../../Assets/Shaders/gShadow",
	1,
	"gShadow"
)

--
-- Material Collection definitions for Light PrePass geometry
--

Global:AddMaterialCollection(
	"lfFlat", "LightFirst",
	"gaFlat", "GeometryAfter",
	"gShadow", "IsCaster",
	3,
	"gFlat"
)

Global:AddMaterialCollection(
	"lfFlat", "LightFirst",
	"gaLantern", "GeometryAfter",
	"gShadow", "IsCaster",
	3,
	"gLantern"
)

Global:AddMaterialCollection(
	"lfFlat", "LightFirst",
	"gaAster", "GeometryAfter",
	"gShadow", "IsCaster",
	3,
	"gAster"
)

Global:AddMaterialCollection(
	"lfVine", "LightFirst",
	"gaVine", "GeometryAfter",
	"gShadow", "IsCaster",
	3,
	"gVine"
)

Global:AddMaterialCollection(
	"lfMoon", "LightFirst",
	"gaMoon", "GeometryAfter",
	2,
	"gMoon"
)

Global:AddMaterialCollection(
	"lfDock", "LightFirst",
	"gaDock", "GeometryAfter",
	"gShadow", "IsCaster",
	3,
	"gDock"
)

Global:AddMaterialCollection(
	"lfGroundGrassFirefly", "LightFirst",
	"gaGroundGrass", "GeometryAfter",
	2,
	"gGroundGrass"
)

Global:AddMaterialCollection(
	"lfGroundGrassFirefly", "LightFirst",
	"gaFirefly", "GeometryAfter",
	2,
	"gFirefly"
)

Global:AddMaterialCollection(
	"lfGround", "LightFirst",--
	"gaGround", "GeometryAfter",--
	"gShadow", "IsCaster",
	3,
	"gGround"
)

Global:AddMaterialCollection(
	"lfGround1", "LightFirst",
	"gaGround1", "GeometryAfter",
	"gShadow", "IsCaster",
	3,
	"gGround1"
)

Global:AddMaterialCollection(
	"lfGround", "LightFirst",
	"gaGround", "GeometryAfter",
	"gShadow", "IsCaster",
	3,
	"gGround2"
)

Global:AddMaterialCollection(
	"lfGround", "LightFirst",
	"gaGround1", "GeometryAfter",
	"gShadow", "IsCaster",
	3,
	"gGround3"
)

Global:AddMaterialCollection(
	"lfGround", "LightFirst",
	"gaGround4", "GeometryAfter",
	"gShadow", "IsCaster",
	3,
	"gGround4"
)

Global:AddMaterialCollection(
	"lfGround", "LightFirst",
	"gaGround1", "GeometryAfter",
	"gShadow", "IsCaster",
	3,
	"gGround5"
)

Global:AddMaterialCollection(
	"lfSky", "LightFirst",
	"gaSky", "GeometryAfter",
	2,
	"gSky"
)

-- firefly particles emit light rays aswell
Global:AddMaterialCollection(
	--"lfFireflyParticle", "LightFirst",
	"gaFireflyParticle", "GeometryAfter",
	"gaLightRay", "LightRay",
	"gaLightRaySimple", "LightRaySimple",
	3,
	"gFireflyParticle"
)

-- firefly particles emit light rays aswell
Global:AddMaterialCollection(
	--"lfFireflyParticle", "LightFirst",
	"gaBlueFireflyParticle", "GeometryAfter",
	"gaLightRay", "LightRay",
	"gaLightRaySimple", "LightRaySimple",
	3,
	"gBlueFireflyParticle"
)

Global:AddMaterialCollection(
	--"lfFireflyParticle", "LightFirst",
	"gaFireflyGetParticle", "GeometryAfter",
	1,
	"gFireflyGetParticle"
)

Global:AddMaterialCollection(
	--"lfFireflyParticle", "LightFirst",
	"gaRing", "GeometryAfter",
	1,
	"gRing"
)

Global:AddMaterialCollection(
	--"lfFireflyParticle", "LightFirst",
	"gaRingInner", "GeometryAfter",
	1,
	"gRingInner"
)

--
-- Can replace with forward shaded
--

Global:AddMaterial( 
	"SHADER", "../../Assets/Shaders/gNentity",
	1,
	"gNentity"
)

Global:AddMaterial(
	"SHADER",  "../../Assets/Shaders/gBlack",
	1,
	"gBlack"
)

Global:AddMaterial(
	"UNIFORM", "0 Color0",
	"TEXTURE", "0 ../../Assets/Textures/introComposite02.bmp",
	"SHADER",  "../../Assets/Shaders/gSingleTexture",
	3,
	"gIntro"
)

Global:AddMaterial(
	--"ALPHATEST", "0.2",
	"UNIFORM", "0 Color0",
	"TEXTURE", "0 ../../Assets/Textures/splashlogos.bmp",
	"SHADER",  "../../Assets/Shaders/gSingleTexture",
	3,
	"gSplashLogos"
)

Global:AddMaterial(
	--"ALPHATEST", "0.2",
	"UNIFORM", "0 Color0",
	"TEXTURE", "0 ../../Assets/Textures/submergedLogo.bmp",
	"SHADER",  "../../Assets/Shaders/gSingleTexture",
	3,
	"gDSMTitle"
)

Global:AddMaterial(
  --"ALPHATEST", "0.4",
  "GAMEINFO", "TextFade", -- "TextSolid", no more!
	"UNIFORM", "0 Color0",
	"TEXTURE", "0 ../../Assets/Textures/font.bmp",
	"SHADER",  "../../Assets/Shaders/text",
	4,
	"Text"
)

Global:AddMaterial(
  --"ALPHATEST", "0.4",
  "GAMEINFO", "TextFade",
	"UNIFORM", "0 Color0",
	"TEXTURE", "0 ../../Assets/Textures/font.bmp",
	"SHADER",  "../../Assets/Shaders/text",
	4,
	"TextFade"
)

--
-- Lighting and water passes
--

--remember, this is actually set in materialMin.xml, since needed immediately.
Global:AddMaterial(
	"UNIFORM", "0 Normal",
	"UNIFORM", "1 Color0",
	"SHADER", "../../Assets/Shaders/lpp/lflplight",
	2,
	"lflPointLight"
)

Global:AddMaterial(
    "BLEND", "PreMultipliedAlpha",
	"UNIFORM", "1 Normal",
	"UNIFORM", "0 Color0",
	"SHADER", "../../Assets/Shaders/lpp/lflarealight",
	"NODEPTH", "none",
	5,
	"lflAreaLight"
)
--[[
Global:AddMaterial(
    "TIMER",   "0.0002",
    "UNIFORM", "4 Normal1",
    "TEXTURE", "4 ../../Assets/Textures/waterWaves.bmp",
    "UNIFORM", "3 Color1",
    "TEXTURE", "3 ../../Assets/Textures/crapmoon.bmp",
	"UNIFORM", "2 Position",
	"UNIFORM", "1 Normal",
	"UNIFORM", "0 Color0",
	"SHADER", "../../Assets/Shaders/lplight",
	9,
	"lWater"
)
--]]
Global:AddMaterial(
    "TIMER",   "0.0002",
	"UNIFORM", "0 Normal",
	"UNIFORM", "1 Color1",
	"TEXTURE", "1 ../../Assets/Textures/rain.bmp",
	"SHADER", "../../Assets/Shaders/lrain",
	5,
	"lRain"
)

--
-- Special stuff 
--

Global:AddMaterial(
  "GAMEINFO", "ViewUp",
  "GAMEINFO", "InvTanHalfFOV",
  "GAMEINFO", "ScreenWidth",
  "GAMEINFO", "ScreenHeight",
  "GAMEINFO", "LightAbove",
  "GAMEINFO", "LightBelow",
  "GAMEINFO", "LightHue",
  "GAMEINFO", "LightAmbientScale",
  --"UNIFORM", "5 Reflection",
  --"TEXTURE", "5 ../../Assets/Textures/randomVectors.bmp",
  "UNIFORM", "4 Occlusion",
  "UNIFORM", "2 Falloff",
	"TEXTURE", "2 ../../Assets/Textures/spot2.bmp",
	"UNIFORM", "0 Normal",
	"UNIFORM", "1 Shadow",
	"SHADER", "../../Assets/Shaders/lpp/lfdefer2",
	14,
	"LightPass"
)

Global:AddMaterial(
  "GAMEINFO", "ViewUp",
  "GAMEINFO", "ScreenWidth",
  "GAMEINFO", "ScreenHeight",
  "GAMEINFO", "LightAbove",
  "GAMEINFO", "LightBelow",
  "GAMEINFO", "LightHue",
  "GAMEINFO", "LightAmbientScale",    
	"UNIFORM", "0 Normal",
	"SHADER", "../../Assets/Shaders/lpp/lfdefer2NoShadows",
	9,
	"LightPassNoShadows"
)


