Hello folks, when a load a glb in cesiumjs, The shadows look zagged. When move close the shadows become crisp. I see none of this problem in other gltf viewer. I have looked around in the forum, but could not find similar issues, hence writing here. appreciate if someone can help me fix this…I have uploaded the model here for reference as well. Here is my code, which i have tried unsuccessfully so far.
const viewer = new Cesium.Viewer(“cesiumContainer”, {
terrain: Cesium.Terrain.fromWorldTerrain(),
timeline: false,
animation: false,
});
// viewer.resolutionScale = 1.2; // Try 1.5–2.0, higher = smoother but slower.
// Turn on Cesium’s light source based on the Sun position
viewer.scene.globe.enableLighting = true;
// Enable dynamic sunlight from the current simulation time
viewer.scene.light = new Cesium.SunLight();
viewer.scene.atmosphere.dynamicLighting =
Cesium.DynamicAtmosphereLightingType.SUNLIGHT;
// viewer.scene.globe.dynamicAtmosphereLighting = true;
// viewer.scene.globe.dynamicAtmosphereLightingFromSun = true;
// Optional: show a visual sun in the skybox
viewer.scene.skyBox = new Cesium.SkyBox({ show: true });
// Enable shadows for models/tilesets
viewer.shadowMap.size = 2048;
viewer.shadowMap.softShadows = true; // Enables softer shadows
viewer.shadowMap.darkness = 0.5; // Adjusts shadow darkness
// You may need to experiment with these values
viewer.scene.shadowMap.enabled = true;
viewer.scene.shadowMap.softShadows = true;
const ambientOcclusion = viewer.scene.postProcessStages.ambientOcclusion;
ambientOcclusion.enabled = true;
ambientOcclusion.intensity = 0.5;
ambientOcclusion.bias = 0.1;
// viewer.scene.highDynamicRange = true
viewer.scene.postProcessStages.tonemapper = Cesium.Tonemapper.ACES
viewer.scene.postProcessStages.fxaa.enabled = true;
25Aug25Eastfield_forCesiumFinal_CemenetStructure-v1.glb (4.4 MB)