Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------------------------------------------------------------------------------------------------
- -- Night settings
- --------------------------------------------------------------------------------------------------------
- if (Spring.GetMapOptions().alt ~= "1") then
- return
- end
- local function Scale(tag, scale)
- local value = loadstring("return mapinfo." .. tag:lower())()
- assert(type(value) == "number")
- loadstring("mapinfo." .. tag:lower() .. " = " .. value * scale)()
- end
- local function ColorShift(tag, shift)
- local color = loadstring("return mapinfo." .. tag:lower())()
- assert(type(color) == "table")
- color[1] = color[1] * shift[1]
- color[2] = color[2] * shift[2]
- color[3] = color[3] * shift[3]
- end
- ------------------------------------------------------------
- -- Relative Settings
- local blueShift = {0.1, 0.3, 0.6}
- local blackShift = {0.05, 0.05, 0.07}
- local darkBlueShift = {0.03, 0.06, 0.1}
- ColorShift("lighting.groundambientcolor", blueShift)
- ColorShift("lighting.grounddiffusecolor", blueShift)
- ColorShift("lighting.groundspecularcolor", blueShift)
- ColorShift("lighting.unitambientcolor", blueShift)
- ColorShift("lighting.unitdiffusecolor", blueShift)
- ColorShift("lighting.unitspecularcolor", blueShift)
- Scale("lighting.groundshadowdensity", 0.4)
- Scale("lighting.unitshadowdensity", 0.4)
- ColorShift("atmosphere.skycolor", darkBlueShift)
- ColorShift("atmosphere.fogcolor", darkBlueShift)
- ColorShift("atmosphere.sunColor", darkBlueShift)
- ColorShift("atmosphere.cloudColor", darkBlueShift)
- Scale("atmosphere.fogstart", 0.5)
- Scale("atmosphere.fogend", 0.7)
- ColorShift("water.planecolor", blackShift)
- ColorShift("water.surfaceColor", blueShift)
- Scale("water.surfaceAlpha", 1.5)
- ColorShift("custom.fog.color", blackShift)
- ------------------------------------------------------------
- -- Absolute Settings
- local cfg = {
- resources = {
- detailTex = "realdetnight.bmp",
- specularTex = "specularmap_night.bmp",
- },
- water = {
- numTiles = 2,
- normalTexture = "waterbump2.png",
- perlinStartFreq = 12.50,
- perlinLacunarity = 1.60,
- perlinAmplitude = 0.24,
- diffuseFactor = 0.40,
- specularFactor = 0.50,
- specularPower = 76,
- ambientFactor = 0.00,
- reflectionDistortion = 0.60,
- },
- }
- return cfg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement