Inverted colors / night mode


Are there plans / thoughts to allow rendering the globe with all colors
inverted in order to create a 'night mode' effect?

Is the postprocessing hook branch usable? Is it going to be merged in
master? Is it expected that mixing primitives and filters result in a black
screen? (See Sandcastle example below).

If post processing filters are not usable, does that mean modifying
- GlobeFS.glsl to handle imagery textures;
- Appearance and Material fragments with colors like
- Label glyphs regeneration;
- Something for Billboard images/canvas.

Is there interest for such a feature?

Sandcastle example:

var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;
var primitives = scene.primitives;

// Create a simple polygon
var polygon = primitives.add(new Cesium.Polygon({
    positions : Cesium.Cartesian3.fromDegreesArray([
         -72.0, 40.0,
         -70.0, 35.0,
         -75.0, 30.0,
         -70.0, 30.0,
         -68.0, 40.0])

function setFilter(scene, filter, uniforms) {
    scene.customPostProcess = new Cesium.CustomPostProcess(filter, uniforms);

// Comment to make it work
setFilter(scene, Cesium._shaders.PassThrough);

Hi Guillaume,

Have you seen the NASA night lights imagery, e.g., that is referenced in the imagery tutorial? You may be able to use this with disabled lighting and perhaps a small tweak to the fragment shaders for lighting.

It will be at least a few months before I expect we’ll be able to focus on the postprocessing branch to get it into master. In the meantime, I can’t speak to the exact state of it, but I know at least Doarama is using it.


Hi Guillaume,

The postprocess-hook branch has been updated to Cesium 1.2. It sounds like you’ve already found the Sandcastle demo. I’ve just made a change to it so it should now work with the polygon.


Hi Patrick and Chris,

Thank you for your replies.

Disabling OIT indeed fixed the issue.

Post processing filters look very promising and is the perfect match for
a global 'inverted colors' effect.