# Transparent Moon Problem

**URL:** <https://community.cesium.com/t/transparent-moon-problem/3921>\
**Category:** CesiumJS\
**Created:** [March 24, 2016, 9:55pm UTC](https://community.cesium.com/t/transparent-moon-problem/3921 "2016-03-24T21:55:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Oneil](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@Daniel\_Oneil](https://community.cesium.com/u/Daniel_Oneil)\
**Post date:** [March 24, 2016, 9:55pm UTC](https://community.cesium.com/t/transparent-moon-problem/3921/1 "2016-03-24T21:55:26Z")

</div>

This  
Cesium demo depicts a Lunar mission with trajectories that were generated from NASA’s General Mission Analysis Tool (GMAT), [http://daoneil.github.io/spacemission/Apps/EarthToMoon\_Transforms.html](http://daoneil.github.io/spacemission/Apps/EarthToMoon_Transforms.html)  
The  
Moon’s orbit and a lunar probe trajectory are loaded from CZML files. Presently, the CZML file loads a solid ellipse as depicted in the first image. It appears that there is a Moon peeking out from behind the ellipse.  
Notice that the from this view point the ellipse hides the Earth. If I change the show parameter to false in the CZML file, the Moon is still there but it is transparent. I the image, it appears that the Earth is in front of the Moon but from this view point the Moon is in front of the Earth.  
How do I get a solid Moon?  
[![](https://lh3.googleusercontent.com/-w0-RCxGK6ZI/VvRcJOU6V7I/AAAAAAAAAOQ/Ukz2eoqHo7EL_jc965BIDKHX363XPiQdQ/s400/LunarOrbit_with_SolidSphere.png)](https://lh3.googleusercontent.com/-w0-RCxGK6ZI/VvRcJOU6V7I/AAAAAAAAAOQ/Ukz2eoqHo7EL_jc965BIDKHX363XPiQdQ/s1600/LunarOrbit_with_SolidSphere.png)

[![](https://lh3.googleusercontent.com/-rx5XKUoK7FI/VvRb8E-4jXI/AAAAAAAAAOM/hF4LsldbKSA-Qp_KtT_1UZN6CzjLt-dTw/s400/Transparent_Moon.png)](https://lh3.googleusercontent.com/-rx5XKUoK7FI/VvRb8E-4jXI/AAAAAAAAAOM/hF4LsldbKSA-Qp_KtT_1UZN6CzjLt-dTw/s1600/Transparent_Moon.png)

Here a snippet of the CZML:

[ {  
“id”:“document”,  
“name”:“LunarOrbit”,  
“version”:“1.0”,  
“clock”:{  
“interval”:“2014-07-22T11:00:  
00Z/2014-08-12T22:07:27Z”,  
“currentTime”:“2014-07-22T11:00:00Z”,  
“multiplier”:60,  
“range”:“LOOP\_STOP”,  
“step”:“SYSTEM\_CLOCK\_MULTIPLIER”  
}},  
{  
“id”: “theMoon”,  
“availability”:[“2014-07-22T11:00:00Z/2014-08-12T22:07:27Z”],  
“ellipsoid” : {  
“radii” : { “cartesian” : [1737000, 1737000, 1737000] },  
“fill” : true,  
“material”:{  
“solidColor”:{ “color”:{ “rgba”:[100,100,100,255] } }  
},  
“show” : false  
},  
“billboard” : {  
“eyeOffset” : {  
“cartesian” : [0.0, 0.0, 0.0]  
},  
“horizontalOrigin” : “CENTER”,

```
    "pixelOffset" : {
        "cartesian2" : [0.0, 0.0]
    },
    "scale" : 0.8,
    "show" : true,
    "verticalOrigin" : "BOTTOM"
},
"label" : {
    "fillColor" : {
        "rgba" : [255, 255, 0, 255]
    },
    "font" : "bold 10pt Segoe UI Semibold",
    "horizontalOrigin" : "LEFT",
    "outlineColor" : {
        "rgba" : [0, 0, 0, 255]
    },
    "pixelOffset" : {
        "cartesian2" : [10.0, 0.0]
    },
    "scale" : 1.0,
    "show" : true,
    "style" : "FILL",
    "text" : "Moon",
    "verticalOrigin" : "CENTER"
},

```

“path” : {  
“color” : { “rgba” : [150, 150, 150, 255] },  
“width” : 1.5  
},  
“position”: {  
“referenceFrame”: “INERTIAL”,  
“cartesian”: []  
} }]

---

<div class="post-metadata">

**Author:** ![hannah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hannah/32/4509_2.png) [@hannah](https://community.cesium.com/u/hannah)\
**Post date:** [March 24, 2016, 10:31pm UTC](https://community.cesium.com/t/transparent-moon-problem/3921/2 "2016-03-24T22:31:50Z")

</div>

We have depth testing disabled for the moon since most people using our library are making earth-centric apps. The problem should be fixed if you change this line of code to depthTestEnabled: true: [https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Moon.js#L86](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Moon.js#L86)

Alternatively, I posted a suggestion in your other forum post for how to use our moon texture on your moon ellipsoid and hide our moon if you wanted to do it that way instead.

Best,

Hannah

---

<div class="post-metadata">

**Author:** ![Jordan\_Estes1](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@Jordan\_Estes1](https://community.cesium.com/u/Jordan_Estes1)\
**Post date:** [November 6, 2018, 3:22pm UTC](https://community.cesium.com/t/transparent-moon-problem/3921/3 "2018-11-06T15:22:45Z")

</div>

Hi Hannah. I'm currently working on a simulation of Apollo 11, so the moon is important for obvious reasons. I tried your solution of setting depthTestEnabled to true for the moon, but with no result.

Another suggestion? I couldn't find the other post you were referring to. Thanks.

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [November 6, 2018, 4:52pm UTC](https://community.cesium.com/t/transparent-moon-problem/3921/4 "2018-11-06T16:52:17Z")

</div>

I think this was Hannah’s suggestion in the other thread:

[https://groups.google.com/d/msg/cesium-dev/92aRR9jbVOM/Xt0zMCO0DQAJ](https://groups.google.com/d/msg/cesium-dev/92aRR9jbVOM/Xt0zMCO0DQAJ)

---

<div class="post-metadata">

**Author:** ![Jordan\_Estes1](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@Jordan\_Estes1](https://community.cesium.com/u/Jordan_Estes1)\
**Post date:** [November 6, 2018, 5:00pm UTC](https://community.cesium.com/t/transparent-moon-problem/3921/5 "2018-11-06T17:00:02Z")

</div>

Yeah. It appears he created an entirely new moon in CZML. But wouldn’t it be easier to just modify Cesium’s default moon, rather than create one from scratch? Shouldn’t changing depthTestEnabled to “true” solve this issue for me? That’s what I’m confused about.

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [November 13, 2018, 5:18pm UTC](https://community.cesium.com/t/transparent-moon-problem/3921/6 "2018-11-13T17:18:43Z")

</div>

I wonder if something else has changed since. Would you be able to open a new thread with a demo and/or screenshots of the issue? The original screenshots from this thread aren’t working anymore.
