Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to increase the brightness of material in 2D mode as well as in 3d mode? #8014

Closed
huochaimindy opened this issue Jul 19, 2019 · 6 comments

Comments

@huochaimindy
Copy link

I want to load GeoJson file, when i load it in 3D mode, the brightness of material is ok. however, when i load it in 2D mode, the brightness of material is very low, how can i increase the brightness in 2D mode as well as in 3d mode?
following picture is in 2d mode, red color is very dark
2d

following picture is in 2d mode, red color is ok
3d

Here is my code in 3D:

<script> var viewer = new Cesium.Viewer('cesiumContainer', { sceneMode: 3 }); var promise = Cesium.GeoJsonDataSource.load('grid222.geojson', { clampToGround: true }); promise.then(function(dataSource) { viewer.dataSources.add(dataSource); var entities = dataSource.entities.values; for (var i = 0; i < entities.length; i++) { var entity = entities[i]; entity.polygon.height = 0.0; } }); viewer.flyTo(promise); </script>

Here is my code in 2D:

<script> var viewer = new Cesium.Viewer('cesiumContainer', { sceneMode: 2 }); var promise = Cesium.GeoJsonDataSource.load('grid222.geojson', { clampToGround: true }); promise.then(function(dataSource) { viewer.dataSources.add(dataSource); var entities = dataSource.entities.values; for (var i = 0; i < entities.length; i++) { var entity = entities[i]; entity.polygon.height = 0.0; } }); viewer.flyTo(promise); </script>

here is geoJson text:
{
"type" : "FeatureCollection",
"features" : [{
"type" : "Feature",
"geometry" : {
"coordinates" : [[[114.37999106868926, 36.0854368313549], [114.37999106868926, 36.087285894830124], [114.38214958987339, 36.087285894830124], [114.38214958987339, 36.0854368313549], [114.37999106868926, 36.0854368313549]]],
"type" : "Polygon"
},
"properties" : {
"fill" : "#FF0000",
"fill-opacity" : 1,
"stroke-width" : 1,
"stroke" : "#FF0000",
"stroke-opacity" : 1
}
}
]
}

@OmarShehata
Copy link
Contributor

I think you need to turn off HDR to get the expected color, see #7966.

For general questions like this, please post a thread in the Cesium forum (https://groups.google.com/forum/#!forum/cesium-dev).

@huochaimindy
Copy link
Author

@OmarShehata
After I turn off HDR, like the following code
viewer.scene.highDynamicRange = false,
The brightness of material color in 2D is also very dark, it looks no effect , Is there any other suggestions? thanks!

@OmarShehata
Copy link
Contributor

Actually, it may be this issue: #5730 which means you'd need to try changing the time of day to set the sun position overhead.

I also have other recommendations in this forum thread about how to control the sun position and other lighting factors @huochaimindy https://groups.google.com/d/msg/cesium-dev/XbeJ1fRlKAA/NhlUtL-CBAAJ

@huochaimindy
Copy link
Author

It worked well by your suggestions. Thanks! @OmarShehata

@hyman4hu
Copy link

hyman4hu commented Jun 1, 2020

It worked well by your suggestions. Thanks! @OmarShehata

Can you tell me how you solved this problem? I have been troubled for several days and tried many methods.

@OmarShehata
Copy link
Contributor

@hyman4hu have you tried the recommendations here #8014 (comment) ?

If you're still having trouble please open a new topic in the Cesium community forum: https://community.cesium.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants