Lighting problem in 2D and 2.5D view

Lighting problem shown in the screenshot attached.

Paste the code below to sandcastle to see the effect:

var viewer = new Cesium.Viewer(‘cesiumContainer’);

var greenRectangle = viewer.entities.add({

name : ‘Green translucent, rotated, and extruded rectangle at height with outline’,

rectangle : {

coordinates : Cesium.Rectangle.fromDegrees(-180.0, -90.0, 180.0, 90.0),

material : Cesium.Color.GREEN.withAlpha(0.5),

extrudedHeight : 300000.0,

height : 100000.0,

outline : true,

outlineColor : Cesium.Color.GREEN

}

});

viewer.zoomTo(viewer.entities);

Screen Shot 2015-06-10 at 6.30.14 PM.png

Screen Shot 2015-06-10 at 6.30.30 PM.png

This is a known issue on some system/browser combinations, see https://github.com/AnalyticalGraphicsInc/cesium/issues/2635 for some additional details.

While I hope we can get this fixed soon, there is an easy workaround. Construct the Viewer with orderIndependentTranslucency set to false.

For example:

var viewer = new Viewer(‘cesiumContainer’,{

orderIndependentTranslucency : false

});

orderIndependentTranslucency is a newer algorithm for rendering translucent geometry in 3D. Disabling it will cause Cesium to fall back to more traditional techniques.

Hi Steven,

#2635 was just fixed and will be in Cesium 1.11 on Wednesday. However, I think #1825 is also affecting your case.

Patrick

Hi, I have tried disabling the OIT in the sandcastle today but it didn't seem to take the shadows away in 2D and 2.5D view. Anyone faced the same problem?

var viewer = new Cesium.Viewer('cesiumContainer',{
    orderIndependentTranslucency : false
});
var redRectangle = viewer.entities.add({
    name : 'Red rectangle with outline',
    rectangle : {
        coordinates : Cesium.Rectangle.fromDegrees(-180, -80.0, 180, 80.0),
        material : Cesium.Color.RED.withAlpha(0.8),
        outline : true,
        outlineColor : Cesium.Color.RED
    }
});

Hi,
I’m having the same issue as well, but for me, it seems to appear as long as the entity’s ‘height’ or ‘extrudedHeight’ property are are being defined. (even if we set the property to 0)

Perhaps,for 2D mode at least, we could ignore these properties?

var viewer = new Cesium.Viewer(‘cesiumContainer’,{
orderIndependentTranslucency : false
});

var redRectangle = viewer.entities.add({
name : ‘Red rectangle with outline’,
rectangle : {
coordinates : Cesium.Rectangle.fromDegrees(-180, -80.0, 180, 0.0),
material : Cesium.Color.RED.withAlpha(0.8),
outline : true,
outlineColor : Cesium.Color.RED
}
});

var redRectangle2 = viewer.entities.add({
name : ‘Red rectangle with outline 2’,
rectangle : {
coordinates : Cesium.Rectangle.fromDegrees(-180, 0.0, 180, 80.0),
material : Cesium.Color.RED.withAlpha(0.8),
height: 0,
outline : true,
outlineColor : Cesium.Color.RED
}
});

``

Hello,

The lighting effect your seeing is a known issue that we have written up here: https://github.com/AnalyticalGraphicsInc/cesium/issues/1825

The reason it only shows up when you use height or extruded height is because there is a different kind of primitive created behind the scenes when height is specified from when it is not specified. Only the one type seems to be having this problem.

Best,

Hannah