# 3D model color is dull or not as bright

**URL:** <https://discourse.threejs.org/t/3d-model-color-is-dull-or-not-as-bright/46002>\
**Category:** Questions\
**Tags:** aframe, 8thwall, materials\
**Created:** [December 20, 2022, 9:14am UTC](https://discourse.threejs.org/t/3d-model-color-is-dull-or-not-as-bright/46002 "2022-12-20T09:14:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![nmikuz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/nmikuz/32/37996_2.png) [@nmikuz](https://discourse.threejs.org/u/nmikuz)\
**Post date:** [December 20, 2022, 9:14am UTC](https://discourse.threejs.org/t/3d-model-color-is-dull-or-not-as-bright/46002/1 "2022-12-20T09:14:41Z")

</div>

Hello I’m having abit of trouble with color on my model. the first image shows the model to have bright red while the other is more dull/whiter.

![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/e/3/e3bbec2d37774c99ee3eb90b76a64c85f434df13.png) ![image (1)](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/8/c/8c72fc48cce7a8dc6b51ba65bbb88769a0c0f270.png)

The bright red is from 8thwall editor preview link while the dull is self-hosted. Not sure why there is a difference though. I’m using a mix of Aframe and ThreeJS.I have this in \< a-scene \>:

> renderer=“colorManagement: true; physicallyCorrectLights: true;”

i have these renderer settings:

```javascript
this.el.sceneEl.renderer.format = THREE.RGBAFormat
this.el.sceneEl.renderer.outputEncoding = THREE.sRGBEncoding
this.el.sceneEl.renderer.physicallyCorrectLights = true
this.el.sceneEl.renderer.toneMappingExposure = 1.1
this.el.sceneEl.renderer.gammaFactor = 2.2

```

texture set like this:

```javascript
const image = document.getElementById('thetexture').src
texturetwo = texLoader.load(image)
texturetwo.flipY = false
texturetwo.encoding = THREE.sRGBEncoding

```

and color set like this:

```javascript
middleColor = new THREE.Color('#000000')
finalColor = new THREE.Color(colorstr)
theModel.traverse((node) => {
    node.material.color.copy(middleColor).lerp(finalColor, op2)
})

```

I’m not sure why the output is inconsistent but any guidance is much appreciated.

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [December 20, 2022, 9:22am UTC](https://discourse.threejs.org/t/3d-model-color-is-dull-or-not-as-bright/46002/2 "2022-12-20T09:22:09Z")

</div>

> [@nmikuz](#):
>
> `this.el.sceneEl.renderer.gammaFactor = 2.2`

That line is not required if you use `THREE.sRGBEncoding` as the output encoding.

> [@nmikuz](#):
>
> `this.el.sceneEl.renderer.toneMappingExposure = 1.1`

If you don’t use HDR in your scene, do not touch tone mapping properties.

> [@nmikuz](#):
>
> ```javascript
> theModel.traverse((node) => {
> node.material.color.copy(middleColor).lerp(finalColor, op2)
> })
> 
> ```

Why do you have these lines in your code? Does 8thwall do the same? Otherwise it’s not surprising when there is a difference in color.

---

<div class="post-metadata">

**Author:** ![nmikuz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/nmikuz/32/37996_2.png) [@nmikuz](https://discourse.threejs.org/u/nmikuz)\
**Post date:** [December 20, 2022, 11:13am UTC](https://discourse.threejs.org/t/3d-model-color-is-dull-or-not-as-bright/46002/3 "2022-12-20T11:13:37Z")

</div>

noted on the gamma and tone mapping.

```javascript
theModel.traverse((node) => {
    node.material.color.copy(middleColor).lerp(finalColor, op2)
})

```

I want to lerp the color from middle color to final color and this option is what I’ve found and does work as intended in both 8thwall and self-hosted, just that the color is dull in self-hosted. Is this not the correct way to use .lerp from color A to color B in material setting?

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [December 20, 2022, 11:27am UTC](https://discourse.threejs.org/t/3d-model-color-is-dull-or-not-as-bright/46002/4 "2022-12-20T11:27:54Z")

</div>

The lerp looks right. There must be something else in your app that produces the difference 🤔.

---

<div class="post-metadata">

**Author:** ![nmikuz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/nmikuz/32/37996_2.png) [@nmikuz](https://discourse.threejs.org/u/nmikuz)\
**Post date:** [December 20, 2022, 11:59am UTC](https://discourse.threejs.org/t/3d-model-color-is-dull-or-not-as-bright/46002/5 "2022-12-20T11:59:43Z")

</div>

What usually impacts color output of models? Just so I can really understand. Currently the base texture is white, and we’re just adding colors to it.

---

<div class="post-metadata">

**Author:** ![donmccurdy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/donmccurdy/32/33209_2.png) [@donmccurdy](https://discourse.threejs.org/u/donmccurdy)\
**Post date:** [December 20, 2022, 2:35pm UTC](https://discourse.threejs.org/t/3d-model-color-is-dull-or-not-as-bright/46002/6 "2022-12-20T14:35:46Z")

</div>

> [@nmikuz](#):
>
> `this.el.sceneEl.renderer.toneMappingExposure = 1.1`

What is renderer.toneMapping? If it’s just NoToneMapping (default) then I think exposure would have no effect… If it’s something else, that’s important to know and would affect colors.

> If you don’t use HDR in your scene, do not touch tone mapping properties.

I think I would loosen this statement a bit, if you are using lights in the scene then tone mapping is appropriate. For unlit materials and baked lights, you generally do not want tone mapping.

Are you able to share this GLB, or a demo to reproduce the issue?

---

<div class="post-metadata">

**Author:** ![nmikuz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/nmikuz/32/37996_2.png) [@nmikuz](https://discourse.threejs.org/u/nmikuz)\
**Post date:** [December 22, 2022, 10:39am UTC](https://discourse.threejs.org/t/3d-model-color-is-dull-or-not-as-bright/46002/7 "2022-12-22T10:39:03Z")

</div>

My problem is solved. Added:

> finalColor = finalColor.convertSRGBToLinear()

---

<div class="post-metadata">

**Author:** ![donmccurdy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/donmccurdy/32/33209_2.png) [@donmccurdy](https://discourse.threejs.org/u/donmccurdy)\
**Post date:** [December 22, 2022, 3:12pm UTC](https://discourse.threejs.org/t/3d-model-color-is-dull-or-not-as-bright/46002/8 "2022-12-22T15:12:57Z")

</div>

I see! In that case, you could instead set…

```javascript
THREE.ColorManagement.legacyMode = false;

```

… before initializing colors. This will convert hexadecimal and CSS-style colors from sRGB to Linear-sRGB automatically.
