|
|
@@ -71,16 +71,20 @@ function loadWaterLayer(url, name, callback) {
|
|
|
id: name || 'water'
|
|
|
});
|
|
|
|
|
|
- const waterMaterial = Cesium.Material.fromType('Water');
|
|
|
- waterMaterial.uniforms.baseWaterColor = new Cesium.Color(0.02, 0.15, 0.25, 0.85);
|
|
|
- waterMaterial.uniforms.blendColor = new Cesium.Color(0.05, 0.25, 0.4, 0.3);
|
|
|
- waterMaterial.uniforms.specularMap = 'Cesium/Assets/Textures/water/watermask.png';
|
|
|
- waterMaterial.uniforms.normalMap = 'Cesium/Assets/Textures/water_normals.jpg';
|
|
|
- waterMaterial.uniforms.frequency = 4000.0;
|
|
|
- waterMaterial.uniforms.animationSpeed = 0.015;
|
|
|
- waterMaterial.uniforms.amplitude = 3.0;
|
|
|
- waterMaterial.uniforms.specularIntensity = 0.8;
|
|
|
- waterMaterial.uniforms.fadeFactor = 1.0;
|
|
|
+ const waterMaterial = new Cesium.Material({
|
|
|
+ fabric: {
|
|
|
+ type: 'Water',
|
|
|
+ uniforms: {
|
|
|
+ baseWaterColor: new Cesium.Color(0.0, 0.12, 0.18, 0.9),
|
|
|
+ normalMap: Cesium.buildModuleUrl('Assets/Textures/waterNormals.jpg'),
|
|
|
+ frequency: 10000.0,
|
|
|
+ animationSpeed: 0.003,
|
|
|
+ amplitude: 2,
|
|
|
+ specularIntensity: 5,
|
|
|
+ direction: 45.0 // 水流方向(角度,0-360 度)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
const waterPrimitive = viewer.scene.primitives.add(new Cesium.Primitive({
|
|
|
geometryInstances: geometryInstance,
|