local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))() local L = game:GetService("Lighting") -- state: mirrors toggle values at runtime local state = { disableBloom = false, disableBlur = false, disableSunRays = false, disableColorGrade = false, disableDepthField = false, disableFog = false, disableShadows = false, reduceLOD = false, reduceParticles = false, } -- helpers local ppMap = { BloomEffect = "disableBloom", BlurEffect = "disableBlur", SunRaysEffect = "disableSunRays", ColorCorrectionEffect = "disableColorGrade", DepthOfFieldEffect = "disableDepthField", } local function applyPP() for _, e in ipairs(L:GetChildren()) do local key = ppMap[e.ClassName] if key then e.Enabled = not state[key] end end end local function applyFog() if state.disableFog then L.FogEnd = 100000; L.FogStart = 99998 else L.FogEnd = 100000; L.FogStart = 0 end end local function applyParts() for _, o in ipairs(workspace:GetDescendants()) do if o:IsA("BasePart") then o.CastShadow = not state.disableShadows end if o:IsA("MeshPart") then o.LevelOfDetail = state.reduceLOD and Enum.LevelOfDetailSetting.Disabled or Enum.LevelOfDetailSetting.Automatic end if o:IsA("ParticleEmitter") then o.Rate = state.reduceParticles and 5 or 20 end if state.reduceParticles and (o:IsA("Smoke") or o:IsA("Fire") or o:IsA("Sparkles")) then o.Enabled = false end end end -- catch newly spawned parts workspace.DescendantAdded:Connect(function(o) if o:IsA("BasePart") then o.CastShadow = not state.disableShadows end if o:IsA("MeshPart") and state.reduceLOD then o.LevelOfDetail = Enum.LevelOfDetailSetting.Disabled end if o:IsA("ParticleEmitter") and state.reduceParticles then o.Rate = 5 end end) L.ChildAdded:Connect(function(e) local key = ppMap[e.ClassName] if key then e.Enabled = not state[key] end end) ------------------------------------------------------- -- RAYFIELD WINDOW ------------------------------------------------------- local Window = Rayfield:CreateWindow({ Name = "Perf Optimizer", ScriptID = "sid_85qxtk45fojc", Icon = 0, LoadingTitle = "Perf Optimizer", LoadingSubtitle = "by you", Theme = "Default", DisableRayfieldPrompts = false, DisableBuildWarnings = false, ConfigurationSaving = { Enabled = true, FileName = "PerfOpt" }, KeySystem = false, }) local Tab = Window:CreateTab("Optimizations", 4483362458) -- section: post processing local SecPP = Tab:CreateSection("Post Processing") local function ppToggle(name, flag, key) Tab:CreateToggle({ Name = name, CurrentValue = false, Flag = flag, Callback = function(v) state[key] = v applyPP() end }) end ppToggle("Disable Bloom", "bloom", "disableBloom") ppToggle("Disable Blur", "blur", "disableBlur") ppToggle("Disable Sun Rays", "sunrays", "disableSunRays") ppToggle("Disable Color Grade", "colorgrade", "disableColorGrade") ppToggle("Disable Depth of Field","dof", "disableDepthField") -- section: world local SecWorld = Tab:CreateSection("World") Tab:CreateToggle({ Name = "Disable Fog", CurrentValue = false, Flag = "fog", Callback = function(v) state.disableFog = v; applyFog() end }) Tab:CreateToggle({ Name = "Disable Shadows", CurrentValue = false, Flag = "shadows", Callback = function(v) state.disableShadows = v; applyParts() end }) Tab:CreateToggle({ Name = "Reduce LOD", CurrentValue = false, Flag = "lod", Callback = function(v) state.reduceLOD = v workspace.StreamingEnabled = v workspace.StreamingTargetRadius = v and 256 or 512 applyParts() end }) Tab:CreateToggle({ Name = "Reduce Particles", CurrentValue = false, Flag = "particles", Callback = function(v) state.reduceParticles = v; applyParts() end }) -- apply all button Tab:CreateSection("Quick Actions") Tab:CreateButton({ Name = "Apply All Optimizations", Callback = function() for k in pairs(state) do state[k] = true end applyPP(); applyFog(); applyParts() workspace.StreamingEnabled = true workspace.StreamingTargetRadius = 256 Rayfield:Notify({ Title = "Perf Optimizer", Content = "All optimizations applied!", Duration = 3, Image = 4483362458, }) end }) Tab:CreateButton({ Name = "Reset Everything", Callback = function() for k in pairs(state) do state[k] = false end applyPP(); applyFog(); applyParts() workspace.StreamingEnabled = false Rayfield:Notify({ Title = "Perf Optimizer", Content = "Reset to defaults.", Duration = 3, Image = 4483362458, }) end }) Rayfield:LoadConfiguration() print("[PerfOpt] Rayfield UI loaded")