GLB model too dark

This GLB model appears too dark in Cesium:

I import it into Cesium ion as 3D model (convert to glTF), disabling Optimize for rendering and Draco compression.

For like half a second it’s brighter and then (maybe when lighting kicks in) it gets dark. At least compared with for example gltf-viewer.donmccurdy.com or compared to our own WebGL visualization, it should be brighter. It may look like a significant difference, but with somewhat darker imagery the effect is even worse.

I’m trying it with “Open complete code example” and adjust the time-of-day to noon, to maximize the lighting. What can be the cause of this? Is there any good glTF debug tool that can help me? It’s converted with our own b3dm/glb converter and I have tried to make sure it doesn’t apply any metallic factor for example.

I wasn’t sure if questions like these belong to Cesium ion or CesiumJS, but I guess the problem is specific to CesiumJS although I’m testing it in Cesium ion.

It doesn’t look like there is anything wrong with the model. But there are many factors coming together that determine the final color/brightness of the model.

For illustration, here is (left to right):

  1. the model rendered with CesiumJS, at noon (!)
  2. the actual texture (in an image viewer)
  3. the model rendered with ThreeJS

The CesiumJS version may look “too dark”. The ThreeJS version may look “too bright”. The combination of sunlight, image-based lighting, tone mapping, and possible exposure settings (which are easily controllable in ThreeJS, but not so easily in CesiumJS) all affect the final brightness.

However, here is a sandcastle that loads a test model (or that can load your model, when it’s hosted on localhost, by adjusting the URL). And it offers a few selection options that make the model “brighter”.

I think that setting the model.lightColor might be the most straightforward one.

(Maybe someone from the CesiumJS core team can give further hints or suggestions)

Thanks Marco, lightColor works fine! I’m still interested in why the noon lighting is a bit low in CesiumJS though, so if someone from the core team can comment on this it would be great.

It looks like the default environment map is too dim. Here is a modified version of Marco’s Sandcastle with a custom environment map (copied from the glTF PBR Extensions Sandcastle). It looks much brighter at the default settings.

There are several threads and issues about ~“dark models”, and the answers until now have been a bit handwaving and not really acknowledging this as an issue.

Can we agree that the default environment map and SHs just are too dark, and this should be tracked in an issue and fixed?

I’ll have look up some details about the default lighting and enviornment handling and what else determines the brightness, and I’m particularly curious about where and why the decision was made to pick this as the default:

Cesium Brightness What The

I think that the default should be brighter. And I know what will happen after this is fixed: People will complain that the models are too bright. And the reason is that people already tweaked the scene.light.intensity, the model.lightColor, or the model.imageBasedLighting.imageBasedLightingFactor according to their needs. But instead of recommending these workarounds, we should probably fix the underlying cause.

EDITED: Other recent threads that are very likely also caused by that:

1 Like