You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As reported on the mailing list, https://groups.google.com/d/msg/cesium-dev/dh3O12530hA/7IqwI3x71lgJ, having geometry with a translucent appearance will cause the alpha value of scene.backgroundColor to be ignored. Below is a complete sandcastle example which shows the problem.
If the appearance or scene.backgroundColor is opaque, everything works as expected, it's only when the appearance and background are both translucent does the background alpha get thrown out.
require(['Cesium'], function(Cesium) {
"use strict";
document.body.style.background = '#0F0';
var viewer = new Cesium.Viewer('cesiumContainer', {
contextOptions : {
webgl : {
alpha : true
}
}
});
viewer.scene.skyBox.destroy();
viewer.scene.skyBox = undefined;
viewer.scene.sun.destroy();
viewer.scene.sun = undefined;
viewer.scene.moon.destroy();
viewer.scene.moon = undefined;
viewer.scene.skyAtmosphere.destroy();
viewer.scene.skyAtmosphere = undefined;
viewer.scene.backgroundColor = new Cesium.Color(0,0,0,0);
Sandcastle.addToolbarButton('Draw Box', function() {
var primitives = viewer.scene.primitives;
// Create box and position with a model matrix
var dimensions = new Cesium.Cartesian3(400000.0, 300000.0, 500000.0);
var positionOnEllipsoid = Cesium.Cartesian3.fromDegrees(-105.0, 45.0);
var boxModelMatrix = Cesium.Matrix4.multiplyByTranslation(
Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid),
new Cesium.Cartesian3(0.0, 0.0, dimensions.z * 0.5));
var boxGeometry = Cesium.BoxGeometry.fromDimensions({
vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
dimensions : dimensions
});
var boxGeometryInstance = new Cesium.GeometryInstance({
geometry : boxGeometry,
modelMatrix : boxModelMatrix,
attributes : {
color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 0.0, 0.0, 0.5))
}
});
primitives.add(new Cesium.Primitive({
geometryInstances : boxGeometryInstance,
appearance : new Cesium.PerInstanceColorAppearance({
closed: true
})
}));
});
Sandcastle.finishedLoading();
});
The text was updated successfully, but these errors were encountered:
As reported on the mailing list, https://groups.google.com/d/msg/cesium-dev/dh3O12530hA/7IqwI3x71lgJ, having geometry with a translucent appearance will cause the alpha value of
scene.backgroundColor
to be ignored. Below is a complete sandcastle example which shows the problem.If the appearance or
scene.backgroundColor
is opaque, everything works as expected, it's only when the appearance and background are both translucent does the background alpha get thrown out.The text was updated successfully, but these errors were encountered: