SHARE
TWEET

Untitled

a guest Sep 1st, 2011 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --------------------------------------------------------------------------------------------------------
  2. -- Night settings
  3. --------------------------------------------------------------------------------------------------------
  4.  
  5. if (Spring.GetMapOptions().alt ~= "1") then
  6.         return
  7. end
  8.  
  9. local function Scale(tag, scale)
  10.         local value = loadstring("return mapinfo." .. tag:lower())()
  11.         assert(type(value) == "number")
  12.         loadstring("mapinfo." .. tag:lower() .. " = " .. value * scale)()
  13. end
  14.  
  15. local function ColorShift(tag, shift)
  16.         local color = loadstring("return mapinfo." .. tag:lower())()
  17.         assert(type(color) == "table")
  18.         color[1] = color[1] * shift[1]
  19.         color[2] = color[2] * shift[2]
  20.         color[3] = color[3] * shift[3]
  21. end
  22.  
  23. ------------------------------------------------------------
  24. -- Relative Settings
  25.  
  26. local blueShift = {0.1, 0.3, 0.6}
  27. local blackShift = {0.05, 0.05, 0.07}
  28.  
  29. local darkBlueShift = {0.03, 0.06, 0.1}
  30.  
  31. ColorShift("lighting.groundambientcolor",  blueShift)
  32. ColorShift("lighting.grounddiffusecolor",  blueShift)
  33. ColorShift("lighting.groundspecularcolor", blueShift)
  34. ColorShift("lighting.unitambientcolor",    blueShift)
  35. ColorShift("lighting.unitdiffusecolor",    blueShift)
  36. ColorShift("lighting.unitspecularcolor",   blueShift)
  37. Scale("lighting.groundshadowdensity", 0.4)
  38. Scale("lighting.unitshadowdensity",   0.4)
  39.  
  40.  
  41. ColorShift("atmosphere.skycolor", darkBlueShift)
  42. ColorShift("atmosphere.fogcolor", darkBlueShift)
  43. ColorShift("atmosphere.sunColor", darkBlueShift)
  44. ColorShift("atmosphere.cloudColor", darkBlueShift)
  45.  
  46. Scale("atmosphere.fogstart", 0.5)
  47. Scale("atmosphere.fogend",   0.7)
  48.  
  49. ColorShift("water.planecolor",   blackShift)
  50. ColorShift("water.surfaceColor", blueShift)
  51. Scale("water.surfaceAlpha", 1.5)
  52.  
  53. ColorShift("custom.fog.color",  blackShift)
  54.  
  55.  
  56. ------------------------------------------------------------
  57. -- Absolute Settings
  58.  
  59. local cfg = {
  60.         resources = {
  61.                 detailTex               =       "realdetnight.bmp",
  62.                 specularTex     =       "specularmap_night.bmp",
  63.         },
  64.  
  65.         water = {
  66.                 numTiles             = 2,
  67.                 normalTexture        = "waterbump2.png",
  68.                 perlinStartFreq      = 12.50,
  69.                 perlinLacunarity     = 1.60,
  70.                 perlinAmplitude      = 0.24,
  71.                 diffuseFactor        = 0.40,
  72.                 specularFactor       = 0.50,
  73.                 specularPower        = 76,
  74.                 ambientFactor        = 0.00,
  75.  
  76.                 reflectionDistortion = 0.60,
  77.         },
  78. }
  79.  
  80.  
  81. return cfg
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top