I’m not sure how computationally expensive it would be to take particle systems into account when casting shadows. One thing you could do for now is create an invisible entity in the position you want that’ll cast the shadow. If it’s completely invisible CesiumJS will automatically not cast a shadow, but you can make it have an alpha of just 0.01:
var shadowEntity = viewer.entities.add({
height : 40.0,
name : ‘Shadow’,
box : {
dimensions : new Cesium.Cartesian3(100.0, 100.0, 1.0),
material : new Cesium.ColorMaterialProperty(new Cesium.Color(0,0,0, 0.01)),
shadows : Cesium.ShadowMode.ENABLED
}
});
``
So here I’m using it to artificially create a shadow over the plane:
I add to my main root a function map.camera.changed.addEventListener(function ()
in in that function I measuring the distance of the camera to array of object in the view scenario ( Cesium.Cartesian3.distance(map.scene.camera.position, <arrayOfpostions))
and according to that I’m change the environment conditions like sky, fog and clouds - in cloud display I change the shadow darkness as function of cloud density.
works wonderful
Ohad
בתאריך יום רביעי, 5 בדצמבר 2018 בשעה 18:18:27 UTC+2, מאת Omar Shehata: