Polygon uvs are improperly computed
Specifically, the water material in the 1.103 version flickers a lot and does not show any ripples. The specific code is as follows. `const viewer = new Viewer("cesiumContainer", { terrain: Terrain.fromWorldTerrain() });
Resource.fetchJson({ url: "sk.geojson" }).then((res) => { res.features.forEach((feature) => { let primitive = new Primitive({ geometryInstances: new GeometryInstance({ geometry: new PolygonGeometry({ polygonHierarchy: new PolygonHierarchy(Cartesian3.fromDegreesArrayHeights(GeoJSONFormat.coordinate2LonLatHeight(feature))), vertexFormat: EllipsoidSurfaceAppearance.VERTEX_FORMAT, perPositionHeight: true }) }), appearance: new EllipsoidSurfaceAppearance({ material: new Material({ fabric: { type: "Water", uniforms: { baseWaterColor: new Color(0.07, 0.20, 0.41, 1), normalMap: "cesiumStatic/Assets/Textures/waterNormals.jpg", frequency: 5000, animationSpeed: 0.01, amplitude: 100, specularIntensity: 0.1 // fadeFactor: 0.2, } } }) }) }); viewer.scene.primitives.add(primitive); }); });
// Add Cesium OSM Buildings, a global 3D buildings layer. const osmBuildingsTileset = await createOsmBuildingsAsync(); viewer.scene.primitives.add(osmBuildingsTileset);`
this is the sandcastle example,select the water material,you will see that. sandcastle link
Change new Cesium.Primitive to new Cesium.GroundPrimitive.
In addition, if the URL contains a lot of content, it is recommended to create a link for it.
Here is an example of creating a water material: sandcastle example
@engineerhe Overall, this is not a bug.
Certainly, thank you for your response and suggestions. I tried your method, and it works for drawing water bodies using GroundPrimitive. However, the issue persists when using Primitive. My requirement is not to have the water bodies attached to the terrain or 3D tiles, but rather to have the water bodies with their own height. Therefore, when drawing water bodies with Primitive, the same issue still exists.
@syzdev
I think, similar to https://github.com/CesiumGS/cesium/issues/11618, this is because polygon uvs are not correctly set.
As workaround you can set the uvs as the example in https://github.com/CesiumGS/cesium/issues/11618 does.
@ggetz The UVs for Cesium polygons should not be calculated on the user's end. Typically, developers on this side are not aware of how your polygon is connected with triangles. Specifying UVs is only necessary for custom Geometry.I personally suggest providing the UVs for polygons as default values, rather than requiring developers to specify them.
I personally suggest providing the UVs for polygons as default values, rather than requiring developers to specify them.
I agree; That is what this issue is tracking.
@engineerhe I don't believe this issue has been addressed. I'm going to go ahead and re-open to keep track.
Closing as this was addressed in https://github.com/CesiumGS/cesium/pull/11874.