# Improve sky segmentation around clouds

**URL:** <https://forum.8thwall.com/t/improve-sky-segmentation-around-clouds/8259>\
**Category:** Technical Support\
**Tags:** threejs\
**Created:** [September 10, 2025, 2:39pm UTC](https://forum.8thwall.com/t/improve-sky-segmentation-around-clouds/8259 "2025-09-10T14:39:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Callum\_Fowler](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@Callum\_Fowler](https://forum.8thwall.com/u/Callum_Fowler)\
**Post date:** [September 10, 2025, 2:39pm UTC](https://forum.8thwall.com/t/improve-sky-segmentation-around-clouds/8259/1 "2025-09-10T14:39:31Z")

</div>

I’ve created a sky segmentation experience, however it seems to struggle with clouds and renders the model sem-transparently in those areas [see image for example]. Is there anyway to make sure the sky segmentation treats clouds as part of the sky?

Thanks,  
Callum

 ![Screenshot 2025-09-10 at 15.36.30](https://us1.discourse-cdn.com/flex019/uploads/x8thwall/original/2X/b/ba9afff5ef56498ef7ad1e4eb6c08e03b8261d40.jpeg)

---

<div class="post-metadata">

**Author:** ![Evan](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.8thwall.com/evan/32/431_2.png) [@Evan](https://forum.8thwall.com/u/Evan)\
**Post date:** [September 15, 2025, 7:01pm UTC](https://forum.8thwall.com/t/improve-sky-segmentation-around-clouds/8259/2 "2025-09-15T19:01:23Z")

</div>

Hey Callum,

At the moment, edge feathering is the only adjustable setting for sky segmentation. That said, a customizable confidence threshold may help with cases like this, we’ve passed your feedback and image along to the product team for consideration.

Thank you!

---

<div class="post-metadata">

**Author:** ![Callum\_Fowler](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@Callum\_Fowler](https://forum.8thwall.com/u/Callum_Fowler)\
**Post date:** [September 16, 2025, 1:53pm UTC](https://forum.8thwall.com/t/improve-sky-segmentation-around-clouds/8259/3 "2025-09-16T13:53:41Z")

</div>

Thanks Evan. Just wondering is there a way to access the sky segmentation mask so I can force it to be either white or black? I saw you comment on [this post](https://forum.8thwall.com/t/sky-segmentation-quality/1067/2), however I’m unsure how to get the texture and manipulate it from the `processCpuResult`.

For context this is how I’m currently trying to access it, but I just get a black screen after passing it in as a uniform to my shader.

_Code to get texture:_

```auto
const onUpdate = ({ processCpuResult }) => {
  const lc = processCpuResult?.layerscontroller
  console.log(lc)
  skyLayer = lc?.layers?.sky || null
}

```

_Code to pass it to Fragment Shader:_

```auto
gMaskShader.uniforms.tMask.value = skyLayer.texture

```

_I have also tried:_

```auto
const SKY_TEX_UNIT = 3

  const fsMesh = gMaskShader._fsQuad._mesh

  if (fsMesh) {
    fsMesh.onBeforeRender = (renderer) => {
      if (!skyLayer?.texture) return

      const gl = renderer.getContext()
      const programMap = renderer.properties
        .get(gMaskShader.material)
        .programs.values()
      const program = programMap.next().value.program

      if (!program) return

      const loc = gl.getUniformLocation(program, 'tMask')

      gl.useProgram(program)
      gl.activeTexture(gl.TEXTURE0 + SKY_TEX_UNIT)
      gl.bindTexture(gl.TEXTURE_2D, skyLayer.texture)
      gl.uniform1i(loc, SKY_TEX_UNIT)
    }
  }

```
