一键导入
minemap-sky-atmosphere
MineMap 天空大气(Sky / SkyAtmosphere)专题。覆盖 map.getSky / enableSkyAtmosphere / disableSkyAtmosphere、瑞利散射、米散射、臭氧分布、太阳盘、大气透视 LUT 与天空盒纹理。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
MineMap 天空大气(Sky / SkyAtmosphere)专题。覆盖 map.getSky / enableSkyAtmosphere / disableSkyAtmosphere、瑞利散射、米散射、臭氧分布、太阳盘、大气透视 LUT 与天空盒纹理。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
MineMap 3D 公告板(Billboard)专题。覆盖 BillboardMaterial / BillboardGeometry / BillboardInstance 动画、拾取高亮、动态纹理更新与轨迹对象联动;不与 DOM 覆盖物 Marker 混淆。
MineMap 云与大气渲染链。用于启用体积云(多层 CloudLayer)、单片实例化云(map.cloudCollection)、大气散射与太阳 / 天空辐照度,重点说明主分支公开参数与禁用字段。
MineMap 事件订阅模型、图层事件代理、once/off 管理、矢量与三维对象拾取。
MineMap 热力图(heatmap)专题。用于二维 / 三维热力图、贴地热力、聚合权重、热力色阶与 3D 显示模式,重点说明 paint/layout 参数边界与典型失败场景。
MineMap KML 数据源。用于加载 KML / KMZ 文件,解析 LineStyle / IconStyle / LabelStyle / PolyStyle 等样式继承,并把 KML 属性映射为 line / circle / fill / symbol 派生图层。
MineMap 材质与着色规范。覆盖 `StandardMaterial`、`PhongMaterial`、`PhysicalMaterial`、`LambertMaterial`、`PolylineMaterial` 等主流材质的选型与调参。
| name | minemap-sky-atmosphere |
| description | MineMap 天空大气(Sky / SkyAtmosphere)专题。覆盖 map.getSky / enableSkyAtmosphere / disableSkyAtmosphere、瑞利散射、米散射、臭氧分布、太阳盘、大气透视 LUT 与天空盒纹理。 |
MineMap 公开的"天空 / 大气"有两条独立路径,业务上不要混用:
minemap-clouds-and-atmospheremap.enableClouds() / map.getClouds()map.getSky() / map.enableSkyAtmosphere() / map.disableSkyAtmosphere()这是两条独立路径。云用 "Cloud / atmosphere effect" 入口;天空大气用
getSky()+enableSkyAtmosphere()入口。
对应 demo:demo/html/SkyAtmosphere.html
var style = {
glyphs: "minemap://fonts/{fontstack}/{range}",
sprite: "minemap://sprite/sprite",
sources: {},
layers: [],
version: 8
};
var map = new minemap.Map({
container: "map",
style,
position: [108.94, 34.31, 442],
pitch: 85.5,
bearing: 53,
maxZoom: 22,
minZoom: 1
});
map.repaint = true;
map.enableLight();
map.enableSkyAtmosphere();
map.on("load", function () {
/* 业务图层加载 */
});
// 业务上做时间联动
map.setSunLightTime({ month, day, hours, minutes });
getSky() 返回 Sky 对象,可以继续访问大气参数(见下表)。
Sky 公开参数| 参数 | 说明 |
|---|---|
useAerialPerspectiveLUT | 是否用 LUT 渲染大气透视(默认 true) |
useSkyViewLUT | 是否用 LUT 渲染天空(默认 true) |
useAerialPerspective | 是否启用大气透视效果(默认 false) |
useSunDisk | 是否渲染日面(默认 true) |
groundHeight | 地表参考高度,单位米;setProps({ groundHeight }) 写入 |
atmosphereHeight | 大气层顶高;setProps({ atmosphereHeight }) |
rayleighDistribution | 瑞利分布尺度(meters 数量级) |
mieDistribution | 米散射分布尺度 |
ozoneDistribution | 臭氧分布 Vector2,两段高度,分别对应 setProps 分量 |
rayleighScatteringCoefficient | 瑞利散射系数 Vector3(R, G, B) |
mieScatteringCoefficient | 米散射系数 |
mieAbsorptionCoefficient | 米散射吸收系数 |
ozoneAbsorptionCoefficient | 臭氧吸收系数 Vector3(R, G, B) |
只读字段直接赋值无效,必须
skyAtmosphere.setProps({ ... })。
map.enableSkyAtmosphere(); // 开启
map.disableSkyAtmosphere(); // 关闭
const sky = map.getSky(); // 拿 Sky 对象调参
源码入口在 source/api/map.js:
enableSkyAtmosphere() → painter.useSkyAtmosphere = truedisableSkyAtmosphere() → painter.useSkyAtmosphere = falsegetSky() → this.style.skySkyAtmosphere 的太阳位置由 SunLight 提供,不自己持有。
业务推荐路径:
map.enableLight(); // 1. 开启光源
map.setSunLightTime({ year, month, day, hours, ... }); // 2. 设时间
const { sunLight } = map.getLights();
sunLight.castShadow = true; // 3. 投影
sunLight.intensity = 1.5; // 4. 强度
详见 minemap-lighting-and-shadows。
useAerialPerspectiveLUT 是 LUT 路径,useAerialPerspective 是"开启真实大气透视"开关,两者不是一回事。
useAerialPerspectiveLUT = true + useAerialPerspective = false:天空 / 远景用 LUT 着色,但不叠加透视衰减useAerialPerspectiveLUT = true + useAerialPerspective = true:在 LUT 基础上叠加真实大气透视useAerialPerspectiveLUT = false:关闭 LUT,纯用基础大气业务上"远山泛蓝"是 useAerialPerspective = true;"天空一片均匀"是 useAerialPerspective = false。
const sky = map.getSky();
sky.setProps({
rayleighScatteringCoefficient: new minemap.Math.Vector3(2e-5, 4e-5, 8e-5),
mieScatteringCoefficient: 1e-5,
mieAbsorptionCoefficient: 8e-6
});
低高度角(早晨 / 黄昏)时 R/G/B 比例偏暖;高高度角(正午)时偏冷。
sky.setProps({
groundHeight: 5e6,
atmosphereHeight: 1e7,
rayleighDistribution: 1e4,
mieDistribution: 5e3,
rayleighScatteringCoefficient: new minemap.Math.Vector3(1e-4, 5e-5, 2e-5)
});
rayleighDistribution / mieDistribution 越小,大气层越"薄"。
map.getSky().loadSkyBoxTextures(painter, skyboxUrls);
map.getSky().removeSkyBoxTextures(options);
业务上一般不需要碰这俩,引擎默认会从 style.sprite / style.glyphs 推。
setProps直接 skyAtmosphere.rayleighScatteringCoefficient = ... 大概率不生效。源码用 setProps({...}) 统一更新材质 Uniform。
Sky 与 Clouds 互相独立enableSkyAtmosphere() 不开云,云层用 enableClouds()enableSkyAtmosphere()useSunDisk 控制日面是否渲染;太阳光方向来自 SunLight,由 setSunLightTime 控制。两者独立。
enableSkyAtmosphere 后必须 enableLight只开大气不开光源,远景不会有阳光感;推荐顺序:
map.enableLight();
map.enableSkyAtmosphere();
useAerialPerspectiveLUT 默认是 true不要无脑设成 false,那样天空颜色会变平。
ozoneDistribution 是 Vector2setProps({ ozoneDistribution: new Vector2(height, width) }),两段独立。SkyAtmosphere.html 的 GUI 写法是先取 ozoneDistribution[0] / [1] 再重组。
enableLight / setSunLightTimerayleighScatteringCoefficient 不生效 → 没用 setPropsuseSunDisk = falseuseAerialPerspective = falsegroundHeight 数值不匹配实际地形enableUnderGround 时大气已自动隐藏(引擎内置),不是 bugdemo/html/SkyAtmosphere.html:完整调试面板(瑞利 / 米 / 臭氧 / 透视 / 日面 / 大气高度)demo/html/PMREMSkyAtmosphere.html:SkyAtmosphere + PMREM 环境贴图组合minemap-clouds-and-atmosphere:云与体积大气(独立路径)minemap-lighting-and-shadows:enableLight / setSunLightTime / SunLightminemap-pmrem-and-environment:map.environment 全局光照环境贴图minemap-terrain-and-analysis:enableUnderGround 与 setTerrain 联动