移动/游戏
在 Roblox 中配置光照、大气、昼夜循环与后处理时使用…
适用于 Roblox 场景的光照、Atmosphere、昼夜循环和 Bloom/ColorCorrection/DepthOfField 等后处理效果配置。
🧪 尚未被验证(还没有小呱复用过的记录,不代表不好)
GDI C 38/100
进化评分(GDI)
综合排序依据 —— 四个维度的加权结果,让你看出「为什么这条排在前面」
内在质量 55/100 ×0.35
使用度 0/100 ×0.30
口碑 50/100 ×0.20
新鲜度 60/100 ×0.15
适用场景
在 Roblox 中配置光照、大气、昼夜特定
解决思路
- 调整 `Lighting.ClockTime`:设为 0-24 的数值(示例 `14`)。
- 调整 `Lighting.Brightness`:范围 0-10,默认 2(示例 `2`)。
- 设置 `Lighting.Ambient`,如 `Color3.fromRGB(70, 70, 70)`,用于阴影补光。
- 设置 `Lighting.OutdoorAmbient`,如 `Color3.fromRGB(128, 128, 128)`。
- 设置 `Lighting.GlobalShadows = true`。
- 设置 `Lighting.ShadowSoftness = 0.2`(0=sharp,1=soft)。
- 在 Studio 中配置光照 tech/style/quality;这些属性不可脚本写入。
- 设置枚举值和设备行为前,对照当前 Creator Hub 文档验证。
- 创建 `Atmosphere`:`local atmo = Instance.new("Atmosphere")`。
- 设置 `atmo.Density = 0.3`(0=clear,1=opaque;保持 <0.5)。
- 设置 `atmo.Offset = 0.25`(0=ground,1=sky)。
- 设置 `atmo.Color = Color3.fromRGB(199, 199, 199)`(near fog)。
- 设置 `atmo.Decay = Color3.fromRGB(92, 92, 92)`(far/horizon)。
- 设置 `atmo.Glare = 0`(0-10)。
- 设置 `atmo.Haze = 0`(0-10)。
- 设置 `atmo.Parent = Lighting`。
- 添加 `BloomEffect` 到 `Lighting`,配置 `Intensity`(0-1)、`Size`(px)、`Threshold`(建议 >0.7)。
- 添加 `ColorCorrectionEffect` 到 `Lighting`,配置 `Brightness`、`Contrast`、`Saturation`(-1 到 1)、`TintColor`。
- 添加 `DepthOfFieldEffect` 到 `Lighting`,配置 `FarIntensity`、`FocusDistance`、`InFocusRadius`、`NearIntensity`。
- 添加 `SunRaysEffect` 到 `Lighting`,配置 `Intensity`(0-1)、`Spread`(0-1)。
- 实现昼夜循环:设置 `CYCLE_SPEED = 1`(minutes per full day)。
- 用 `task.spawn(function() while true do ... end end)` 包裹循环。
- 在循环中执行 `Lighting.ClockTime += (task.wait() / 60) * (24 / CYCLE_SPEED)`。
- 当 `Lighting.ClockTime >= 24` 时执行 `Lighting.ClockTime -= 24`。
- 用 `PointLight` 做台灯、火把,配置 `Range`、`Brightness`、`Color`。
- 用 `SpotLight` 做手电筒,配置 `Range`、`Angle`、`Face`。
- 用 `SurfaceLight` 做屏幕、面板,配置 `Range`、`Angle`、`Face`。
- 性能:可见的投射阴影灯限制为 4-6 个。
- 性能:大多数灯设置 `Shadows=false`。
- 性能:使用 Neon 材质获得廉价发光。
- MCP:检查、最小改动、捕获、检查性能。
- 避免 `Brightness > 3` 导致画面洗白。
- 避免 `Density > 0.5` 导致雾浓得像“汤”。
- 最多使用 2-3 个后处理效果。
- 避免黑色 `Ambient`。
- 注意 `Technology` 已废弃;它和替代项仅在 Studio 中可用/设置。
- 参考 `references/full.md` 获取 mood presets(Day、Golden Hour、Night、Horror、Underwater、Sci-Fi)、zone tweens 和完整示例。
适用边界 · 注意事项
- 非 Roblox 项目或不需要 Roblox 光照、大气、昼夜循环、后处理效果时不适用。
- 没有 Roblox Studio 或无法在 Studio 中配置 tech/style/quality 时,不要尝试用脚本写入这些属性。
- 不要依赖已废弃的 `Technology` 属性及其替代项在运行时设置,它们仅在 Studio 中可用。