1. A concise explanation of the problem you’re experiencing.
When you zoom to rectangle with material, the material “slips” and disappears from the edge closer to the viewer
Screenshots
Before zoom
after zoom
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
var viewer = new Cesium.Viewer(‘cesiumContainer’, {
});
var worldRectangle;
var rectangle = Cesium.Rectangle.fromDegrees( 5.3, 52.8, 5.4, 52.9) ;
worldRectangle = viewer.scene.primitives.add(new Cesium.Primitive({
geometryInstances : new Cesium.GeometryInstance({
geometry : new Cesium.RectangleGeometry({
rectangle : rectangle,
vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT
})
}),
appearance : new Cesium.EllipsoidSurfaceAppearance({
aboveGround : false
}),
shadows : Cesium.ShadowMode.RECEIVE_ONLY,
}));
worldRectangle.appearance.material = new Cesium.Material({
fabric : {
type : ‘Water’,
uniforms : {
baseWaterColor : new Cesium.Color(0.024, 0.128, 0.225, 1.0), // baseWaterColor : new Color(0.2, 0.3, 0.6, 1.0),
blendColor : new Cesium.Color(0.0, 1.0, 0.699, 1.0), // blendColor : new Color(0.0, 1.0, 0.699, 1.0),
// specularMap : ‘images/specular.jpg’, // specularMap : Material.DefaultImageId,
normalMap: ‘Assets/Textures/waterNormals.jpg’, // normalMap : Material.DefaultImageId,
frequency : 5000.0, // frequency : 10.0,
animationSpeed : 0.0005, // animationSpeed : 0.01,
amplitude : 2, // amplitude : 1.0,
specularIntensity : 0.25, // specularIntensity : 0.5,
fadeFactor : 1.0 // fadeFactor : 1.0
}
}
});
viewer.camera.setView({
destination : Cesium.Rectangle.fromDegrees(5.1, 52.44, 5.6, 52.46),
orientation: {
heading : Cesium.Math.toRadians(0.0), // east, default value is 0.0 (north)
pitch : Cesium.Math.toRadians(-40), // default value (looking down)
roll : 0.0 // default value
}
});
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I’d like to put a water material over some region
4. The Cesium version you’re using, your operating system and browser.
Cesium 1.45, Chrome
Vladimir