fix: 大幅增强SRTM高程数据地形可见性
问题: - 上传SRTM数据后预览仍然看不到明显地形起伏 - 原因:SRTM 90米分辨率数据高差相对平缓,需要更强的视觉增强 修复内容: 1. 垂直夸张系数从2.0增加到5.0倍(针对SRTM等低分辨率数据) 2. 增强光照:添加定向光源,强度2.0,优化阴影对比度 3. 优化相机视角:pitch从-0.6改为-1.0(更倾斜),距离从2.4x改为2.0x(更近) 4. 更新用户提示文字,说明使用了5倍垂直夸张 技术细节: - DirectionalLight方向(0.2, 0.5, -0.8)产生侧光效果,增强地形阴影 - 更陡的相机角度让用户能更清楚地看到起伏 - 更近的距离让90米分辨率的细节更可见 影响范围: - 用户现在可以清晰看到SRTM数据的地形起伏 - 山脉、山谷、坡度变化都有明显的视觉效果 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -150,6 +150,11 @@ export function ElevationPreviewCesiumMap({
|
||||
viewer.scene.globe.baseColor = Cesium.Color.fromCssColorString("#0f172a");
|
||||
// Enable lighting to enhance terrain visibility with shadows
|
||||
viewer.scene.globe.enableLighting = true;
|
||||
// Increase lighting intensity for better terrain shadow contrast
|
||||
viewer.scene.light = new Cesium.DirectionalLight({
|
||||
direction: new Cesium.Cartesian3(0.2, 0.5, -0.8),
|
||||
intensity: 2.0,
|
||||
});
|
||||
viewer.scene.backgroundColor = Cesium.Color.fromCssColorString("#020617");
|
||||
viewer.scene.screenSpaceCameraController.enableCollisionDetection = true;
|
||||
const creditContainer = viewer.cesiumWidget.creditContainer as HTMLElement | null;
|
||||
@@ -214,8 +219,9 @@ export function ElevationPreviewCesiumMap({
|
||||
}
|
||||
|
||||
setTerrainError("");
|
||||
// Increase vertical exaggeration to make terrain relief more visible
|
||||
viewer.scene.verticalExaggeration = 2.0;
|
||||
// Significantly increase vertical exaggeration for SRTM data (90m resolution)
|
||||
// SRTM data often has subtle elevation changes that need strong exaggeration
|
||||
viewer.scene.verticalExaggeration = 5.0;
|
||||
viewer.scene.verticalExaggerationRelativeHeight = 0.0;
|
||||
|
||||
// Remove all existing imagery layers first
|
||||
@@ -445,7 +451,9 @@ export function ElevationPreviewCesiumMap({
|
||||
const boundingSphere = Cesium.BoundingSphere.fromPoints(positions);
|
||||
void viewer.camera.flyToBoundingSphere(boundingSphere, {
|
||||
duration: 0.8,
|
||||
offset: new Cesium.HeadingPitchRange(0, -0.6, Math.max(1200, boundingSphere.radius * 2.4)),
|
||||
// Use steeper pitch angle (-1.0) to better show terrain relief
|
||||
// Closer distance (2.0x instead of 2.4x) to see more detail
|
||||
offset: new Cesium.HeadingPitchRange(0, -1.0, Math.max(1200, boundingSphere.radius * 2.0)),
|
||||
});
|
||||
}
|
||||
}, [altitudeRange.max, altitudeRange.min, dataset, ready, safeCells, safePoints, terrainError, terrainRenderState]);
|
||||
@@ -467,7 +475,7 @@ export function ElevationPreviewCesiumMap({
|
||||
return (
|
||||
<div className="space-y-2">
|
||||
<div className="text-xs text-slate-500">
|
||||
颜色由蓝到红表示高程由低到高;地形瓦片就绪时优先加载真实三维地形,失败时自动回退到现有色带/点位预览。
|
||||
颜色由蓝到红表示高程由低到高;地形瓦片就绪时优先加载真实三维地形(垂直夸张5倍以增强可见性),失败时自动回退到现有色带/点位预览。
|
||||
</div>
|
||||
{terrainError ? (
|
||||
<Alert
|
||||
|
||||
Reference in New Issue
Block a user