Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Модуль для улучшенной графики
- local GraphicsEnhancer = {}
- -- Настройки (можно менять)
- local settings = {
- enabled = true, -- Включено по умолчанию
- bloomEnabled = true,
- bloomIntensity = 0,
- bloomSize = 0,
- bloomThreshold = 0.7,
- colorCorrectionEnabled = true,
- colorCorrectionBrightness = 0.1,
- colorCorrectionContrast = 0.2,
- colorCorrectionSaturation = 0.1,
- colorCorrectionTintColor = Color3.fromRGB(255, 220, 220),
- depthOfFieldEnabled = true,
- depthOfFieldFarIntensity = 0,
- depthOfFieldFocusDistance = 10,
- depthOfFieldInFocusRadius = 15,
- depthOfFieldNearIntensity = 0.5,
- sunRaysEnabled = true,
- sunRaysIntensity = 0.2,
- sunRaysSpread = 1
- }
- -- Функция для применения эффектов
- function GraphicsEnhancer.applyEffects()
- if not settings.enabled then return end
- local lighting = game:GetService("Lighting")
- -- Очищаем старые эффекты
- for _, effect in ipairs(lighting:GetChildren()) do
- if effect:IsA("BloomEffect") or effect:IsA("ColorCorrectionEffect") or
- effect:IsA("DepthOfFieldEffect") or effect:IsA("SunRaysEffect") then
- effect:Destroy()
- end
- end
- -- Bloom эффект (свечение)
- if settings.bloomEnabled then
- local bloom = Instance.new("BloomEffect")
- bloom.Intensity = settings.bloomIntensity
- bloom.Size = settings.bloomSize
- bloom.Threshold = settings.bloomThreshold
- bloom.Parent = lighting
- end
- -- Коррекция цвета
- if settings.colorCorrectionEnabled then
- local colorCorrection = Instance.new("ColorCorrectionEffect")
- colorCorrection.Brightness = settings.colorCorrectionBrightness
- colorCorrection.Contrast = settings.colorCorrectionContrast
- colorCorrection.Saturation = settings.colorCorrectionSaturation
- colorCorrection.TintColor = settings.colorCorrectionTintColor
- colorCorrection.Parent = lighting
- end
- -- Глубина резкости
- if settings.depthOfFieldEnabled then
- local dof = Instance.new("DepthOfFieldEffect")
- dof.FarIntensity = settings.depthOfFieldFarIntensity
- dof.FocusDistance = settings.depthOfFieldFocusDistance
- dof.InFocusRadius = settings.depthOfFieldInFocusRadius
- dof.NearIntensity = settings.depthOfFieldNearIntensity
- dof.Parent = lighting
- end
- -- Солнечные лучи
- if settings.sunRaysEnabled then
- local sunRays = Instance.new("SunRaysEffect")
- sunRays.Intensity = settings.sunRaysIntensity
- sunRays.Spread = settings.sunRaysSpread
- sunRays.Parent = lighting
- end
- -- Дополнительные настройки освещения
- lighting.GlobalShadows = true
- lighting.Brightness = 2
- lighting.OutdoorAmbient = Color3.fromRGB(128, 128, 128)
- lighting.ClockTime = 7 -- Установлено на 7 часов (7h)
- lighting.GeographicLatitude = 45
- lighting.ExposureCompensation = 0.25
- end
- -- Функция для включения/выключения
- function GraphicsEnhancer.setEnabled(state)
- settings.enabled = state
- GraphicsEnhancer.applyEffects()
- end
- -- Функция для обновления настроек
- function GraphicsEnhancer.updateSettings(newSettings)
- for key, value in pairs(newSettings) do
- if settings[key] ~= nil then
- settings[key] = value
- end
- end
- GraphicsEnhancer.applyEffects()
- end
- -- Применяем эффекты сразу при загрузке
- GraphicsEnhancer.applyEffects()
- return GraphicsEnhancer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement