问题
I think my Cesium globe is too dark. Here is two images: one from Cesium and other from OpenLayers, both from same location and same geoserver layer.
Already set viewer.scene.globe.enableLighting = true;
as you can see in image below:
My setup:
viewer = new Cesium.Viewer('cesiumContainer',{
timeline: false,
animation: false,
baseLayerPicker: false,
geocoder : false,
infoBox : false,
selectionIndicator : true,
navigationHelpButton : false,
});
viewer.scene.globe.enableLighting = true;
var scene = viewer.scene;
var imageryLayers = scene.imageryLayers;
baseLayer = imageryLayers.get(0);
imageryLayers.remove( baseLayer );
var baseProvider = new Cesium.WebMapServiceImageryProvider({
url : myUrl,
layers : 'osm:OSMMapa',
parameters : {
transparent : true,
format : 'image/png',
tiled : true,
}
});
imageryLayers.addImageryProvider( baseProvider );
how can I set my view to be brighter like OpenLayers and show the image as it realy is?
回答1:
A couple of things you can try here:
First, enableLighting
can be false, if you don't care about time or don't want the "night side" of the globe to be dark. It's counter-intuitive that turning off lighting would make things brighter, but really this flag is about turning off the lighting calculations, replacing them with full brightness always.
But the more effective thing, at least in the short term, may be to turn off HDR:
viewer.scene.highDynamicRange = false;
"High Dynamic Range" applies to fancy 3D models and their reflections, and in current versions of Cesium it also involves a color processing technique called tone-mapping. But if you're not using any of that, then this is all irrelevant to you, and is actually hurting the contrast of the images.
The behavior of this may change in a future release to be a little smarter about when and how tone-mapping is applied. But for now, the workaround is to turn off HDR.
来源:https://stackoverflow.com/questions/56636467/is-it-normal-this-dark-image-in-cesium