cEnvironment = {
	MORNING = {
		skybox = { "cloudy.dds" } ,
		skyboxtint = { 1, .4, .2 },
		skyboxbrightness = { .6 },
		fogColor = { 1, .2, .1 },
		fogParams = { 30, 160, 0.95, 6 },
		sunBrightness = { 0 },
		sunColorTint = { 1, 1, 1 },
		sunFogScale = { 1 },
		sunGlare = { 1 },
		ambient = { 1.1 },
		ambientexponent = { 1.0 },
		exposure = { 2, 5 },
		nightlight = { false },
	},
	DAY = {
		skybox = { "day.dds" },
		skyboxtint = { 1, 1, 1 },
		skyboxbrightness = { 1 },
		fogColor = { .9, .9, .9 },
		fogParams = { 50, 200, 0.9, 8 },
		sunBrightness = { 6 },
		sunColorTint = { 1, .8, .6 },
		sunFogScale = { 0.15 },
		sunGlare = { 1 },
		ambient = { 1.1 },
		ambientexponent = { 1.0 },
		exposure = { 1, 5 },
		nightlight = { false },
	},
	EVENING = {
		skybox = { "sunset.dds" },
		skyboxtint = { 1, .5, .2 },
		skyboxbrightness = { 1 },
		fogColor = { .3, .2, .08 },
		fogParams = { 80, 200, 1, 6 },
		sunBrightness = { 1 },
		sunColorTint = { .2, .3, 1 },
		sunFogScale = { 1.0 },
		sunGlare = { 0.8 },
		ambient = { 1.1 },
		ambientexponent = { 1.0 },
		exposure = { 1, 5 },
		nightlight = { false },
	},
	NIGHT = {
		skybox = { "cloudy.dds" },
		skyboxtint = { 1, 1, 1 },
		skyboxbrightness = { 0.05 },
		fogColor = { .02, .02, .024 },
		fogParams = { 20, 120, 0.9, 2 },
		sunBrightness = { 0 },
		sunColorTint = { 1, 1, 1 },
		sunFogScale = { 1 },
		sunGlare = { 1 },
		ambient = { 1 },
		ambientexponent = { 1.3 },
		exposure = { 1, 5 },
		nightlight = { true },
	},
}

function cEnvironment:SolidBackground(r, g, b, a, sprite, dist, cam)
    r = r or 0
    g = g or 0
    b = b or 0
    a = a or 1
    sprite = sprite or LoadSprite('ui/menu/white_32.png')
    cam = cam or GetCameraTransform()
    dist = dist or 256

	local transforms = {
		Transform(VecAdd(cam.pos, Vec(0, 0, dist))),
		Transform(VecAdd(cam.pos, Vec(0, 0, -dist))),
		Transform(VecAdd(cam.pos, Vec(-dist, 0, 0)), QuatEuler(0, 90, 0)),
		Transform(VecAdd(cam.pos, Vec(dist, 0, 0)), QuatEuler(0, 90, 0)),
		Transform(VecAdd(cam.pos, Vec(0, -dist, 0)), QuatEuler(90, 0, 0)),
		Transform(VecAdd(cam.pos, Vec(0, dist, 0)), QuatEuler(90, 0, 0)),
	}
	for _, v in pairs(transforms) do
		DrawSprite(sprite, v, dist * 2 + 2, dist * 2 + 2, r, g, b, a, true, false)
	end
end

function cEnvironment:ApplyPreset(name)
	if not self[name] then return end

	for k, v in pairs(self[name]) do
        SetEnvironmentProperty(k, unpack(v))
	end
end
