# Changing opacity of 3d tileset in 2d mode

**URL:** <https://community.cesium.com/t/changing-opacity-of-3d-tileset-in-2d-mode/42704>\
**Category:** CesiumJS\
**Created:** [August 13, 2025, 8:41am UTC](https://community.cesium.com/t/changing-opacity-of-3d-tileset-in-2d-mode/42704 "2025-08-13T08:41:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xingjizh1007](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/xingjizh1007/32/28173_2.png) [@Xingjizh1007](https://community.cesium.com/u/Xingjizh1007)\
**Post date:** [August 13, 2025, 8:41am UTC](https://community.cesium.com/t/changing-opacity-of-3d-tileset-in-2d-mode/42704/1 "2025-08-13T08:41:40Z")

</div>

Hi, I have loaded a 3d point cloud as tileset on cesium viewer, applied custom shader, and tried to change opacity of the 3d point cloud.

It works fine in 3d mode, but not in 2d mode.

Here is my implementation:

```auto
      // To Load point cloud from tile service url.
      const tileset = await Cesium3DTileset.fromUrl(resource, {
        projectTo2D: true,
        
      });

```

```auto
      tileset.pointCloudShading = new PointCloudShading({
        geometricErrorScale: 1.0,
        baseResolution: 1.0,
        attenuation: true,
        eyeDomeLighting: true,
        eyeDomeLightingRadius: 0,
        eyeDomeLightingStrength: 0,
      });

```

```auto
        tileset.customShader = new CustomShader({
          lightingModel: LightingModel.UNLIT,
          translucencyMode: CustomShaderTranslucencyMode.OPAQUE,
          uniforms: {
            u_alpha: { type: UniformType.FLOAT, value: 1.0 }, // Opacity value
            u_pointSize: { type: UniformType.FLOAT, value: 5.0 }, // Point Size value
            u_shape: { type: UniformType.BOOL, value: false }, // Point shape: true for Square, false for Circle.
          },
          vertexShaderText: `
            void vertexMain(VertexInput vsIn, inout czm_modelVertexOutput vsOut) {
              vsOut.pointSize = u_pointSize;
            }
          `,
          fragmentShaderText: `
            void fragmentMain(FragmentInput fsIn, inout czm_modelMaterial material) {
              float distance = length(gl_PointCoord - 0.5);
              if (distance > 0.5) {
                if (u_shape) {
                  discard; // Comment this line for square point shape
                }
              }
              material.alpha = u_alpha; // Change opacity
            }
          `,
        });

```

In 3d mode:

 ![image](https://global.discourse-cdn.com/cesium/original/3X/1/3/131640dc28d6d5c5ad78c7c6ec59bafa38bb9bd2.jpeg)

In 2d mode, it looks like opacity is always 1.0:

Is there anyway to change opacity of 3d point cloud in 2d mode?

---

<div class="post-metadata">

**Author:** ![mzschwartz5](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/mzschwartz5/32/30089_2.png) [@mzschwartz5](https://community.cesium.com/u/mzschwartz5)\
**Post date:** [August 14, 2025, 3:48pm UTC](https://community.cesium.com/t/changing-opacity-of-3d-tileset-in-2d-mode/42704/3 "2025-08-14T15:48:05Z")

</div>

Hi @Xingjizh1007 ,

Interesting… lots going on here. One thing I notice off the bat is:

```javascript
          translucencyMode: CustomShaderTranslucencyMode.OPAQUE,

```

Which is weird, because your opacity seems to “work” anyway. In fact, making this value `TRANSLUCENT` seems to really make the visualization worse, for some reason. _However_, in 2D mode, setting this to `OPAQUE` seems to prevent the point cloud from rendering at all.

[Sandcastle demo I did my testing in](https://sandcastle.cesium.com/#c=lVVbbxo5FP4rR2gfBon1JGm7D0CjZUkqIZEQhUn7gpQYjwG3Hntqe0hJxX/f47EnTChbaZ/GPpfvfMfnMml6p4VyMJa6ymG5gzujVwTuuOMGRlJy1YOxllWxFBQelNhyY4Xbwb1eaieYhSldEpgzqpRQaw8wkvwrVbnRkBnNmJYC8Ao31HEBY6EZNVJwslBMK+tgK/gzhvoIij/DmFtRFeRzLUsWHVbfx1o5KhQ3i04Pfi4UAJIzKOk3Dlm4k5XRxRdtZB4FSbe3UPvuYKEWKgQilnHFSaFzjjGj+9zLblBE5uPr2+uLq9rBmV2IFog6IbnlDr3oMxWu8Q2fd1dZUNcUJlqNLF4meXL+1/uL88gaoDT6K2cu0xdXfXCm4l5c84MGn5S+HnU55hua+0d98zZ3x+okYq+5Lrgzgl0bow1WRPI+nJOzXlAvqeX33GIpndCqraHOcVXRIPakopzv+BVCTsV64zDO73T3yKSyfTg7rZ47w9XabRqDmHE7a1ZZpwuf0nEzjFuaJlcZgX3N5GsXTNtS8nA7nWSRjzNUWVlhmdnOa/unwLMjI5Ldj27n0wdsiQanUmKlTYGZRiIoeqSy3FCUgNuVB+SHYJqhjHyazkZZD7ZUVmhwRj7AvgdpCrOSMj9MteIAWHfAXLzw/wH6gZxF0DDP3v0Y125o+XvMf2az6SvkikrL34BGAN8HgD4w/15Rw3vR0kvGwjDph9tH3MdXw53h+I/4yPyH68NTQ2qrRR71N35eP9fHiSor3Ax2gstHKI1n9lI8+pmVwWBWuWCBh+6hFhAk5PUBsZNazzlo7Pbh8BT5rQxdFxxt/pNhY1Fz/BQvgeXqFEu/7IygEop4eENyJTV1kAvrqGKeo6ynI1nLxzDdWpsc/vSN0h0c3MQKkleny1rbRg0GscpHGvDRcPHmA1/MsS48f3AbYXGUVCidrYsJ5aHSbYT94dI6NumRegYwEyQ1SNM4EyHYhqo1Bx1a/WQFWuvgzZIujSiEw1+OJTTPk7gqgnE0fNG6yHRbtQdGHdtAwv0a7B42uMa+lHqdPNX7EbAG9XKNrn3442ftsX8KKJ1eZ2jdTvLLhvPfoii1cVAZmRCSOl6UEvO36bJi3/wKs7Yp1zBtuw5zsQWRfzzxPwMmqbWoWVVS+h5ddC6HKdr/4hr5znBYJN15s8355TQICSHDFK+nPZ3WcknNEfK/).

Moreover, there is definitely weird interaction between translucency and eye dome lighting. I found [this existing issue about it](https://github.com/CesiumGS/cesium/issues/8550). And there’s a [similar forum post as well](https://community.cesium.com/t/point-cloud-translucency-and-eye-dome-lighting/38369).

Unfortunately, the best thing I can suggest right now is to plus-one that issue so it gets more attention, and, as always, you can consider [contributing](http://github.com/CesiumGS/cesium/blob/main/Documentation/Contributors/README.md) to Cesium yourself. We appreciate any and all contributions!

Best,  
Matt
