# Opacity of clearColor in my babylon js scene has no effect

**URL:** <https://forum.babylonjs.com/t/opacity-of-clearcolor-in-my-babylon-js-scene-has-no-effect/48030>\
**Category:** Bugs\
**Created:** [February 14, 2024, 3:59pm UTC](https://forum.babylonjs.com/t/opacity-of-clearcolor-in-my-babylon-js-scene-has-no-effect/48030 "2024-02-14T15:59:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sacha\_cln](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sacha_cln/32/37753_2.png) [@Sacha\_cln](https://forum.babylonjs.com/u/Sacha_cln)\
**Post date:** [February 14, 2024, 3:59pm UTC](https://forum.babylonjs.com/t/opacity-of-clearcolor-in-my-babylon-js-scene-has-no-effect/48030/1 "2024-02-14T15:59:49Z")

</div>

Hello everyone.  
I’m working on a 360° scene project with babylonJS. In this project I’m using [babylon-htmlmesh - npm](https://www.npmjs.com/package/babylon-htmlmesh), a new extension that allows html integration directly on a mesh. However, using this extension requires the clearColor of my scene to be transparent, which I’m trying to do like this:  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/f/6/f64827f01113a49a37eb3f8db6b3f3211189cb01.png)  
Unfortunately, and this is the whole point of this topic, this parameter is not taken into account, preventing me from using the HtmlMesh extension.  
Here’s how I instantiate my scene:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/1/e/1eb7d40a0cafef5c5141d07c223611ef5665a53d.png)  
And here are three images showing my background without changing its opacity  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/0/20568dc284b45b7f4b87c302fd103f1739325dbf.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/3/332da009fcc51b5bb3cc08fb60138340d7d73583.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/0/3093faefcf1d88eb1279aa75365fca9a3f26f3b1.jpeg)

Does anyone have any idea how to solve this problem and where it comes from?  
Thanks in advance for your feedback!

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [February 15, 2024, 10:39am UTC](https://forum.babylonjs.com/t/opacity-of-clearcolor-in-my-babylon-js-scene-has-no-effect/48030/2 "2024-02-15T10:39:27Z")

</div>

cc @ericwood73, who created the htmlmesh extension, in case it rings a bell.

---

<div class="post-metadata">

**Author:** ![ericwood73](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ericwood73/32/22967_2.png) [@ericwood73](https://forum.babylonjs.com/u/ericwood73)\
**Post date:** [February 15, 2024, 4:15pm UTC](https://forum.babylonjs.com/t/opacity-of-clearcolor-in-my-babylon-js-scene-has-no-effect/48030/3 "2024-02-15T16:15:12Z")

</div>

Actually, this was originally posted in the HtmlMesh topic, but I suggested it be posted here becasue I don’t see how this could be related to HtmlMesh usage. Could creating a skybox somehow affect the clear color? @Sacha_cln Might be worth commenting out the htmlmesh and/or skybox and see if that changes anything.

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [February 15, 2024, 8:39pm UTC](https://forum.babylonjs.com/t/opacity-of-clearcolor-in-my-babylon-js-scene-has-no-effect/48030/4 "2024-02-15T20:39:11Z")

</div>

Also, a repro in the Playground or somewhere else would help a lot!

---

<div class="post-metadata">

**Author:** ![Sacha\_cln](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sacha_cln/32/37753_2.png) [@Sacha\_cln](https://forum.babylonjs.com/u/Sacha_cln)\
**Post date:** [February 16, 2024, 8:29am UTC](https://forum.babylonjs.com/t/opacity-of-clearcolor-in-my-babylon-js-scene-has-no-effect/48030/5 "2024-02-16T08:29:22Z")

</div>

Thank you for your answers. I didn’t use the playground because when I integrated my code into it I got the desired result which I didn’t get on my Angular project.  
But I found the problem! There were actually two.

**1st problem** : there was a background-color effect in the scss of the component in which I integrated my babylonjs component that impacted the comportment  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/1/f/1fd89324294a25b23f013008f51635ab293fa3a8.png)

**2nd problem** : there was a rgb(0,0,0) effect on my HtmlMeshDiv. I had to apply this property on top of it:  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/a/e/ae9b7929c9a8bb29466f5911f767e704e8cce554.png)

But now it seems to work perfectly!
