# Deprecated gamma correction alternative

**URL:** <https://discourse.threejs.org/t/deprecated-gamma-correction-alternative/57170>\
**Category:** Questions\
**Tags:** gamma\
**Created:** [October 18, 2023, 7:13pm UTC](https://discourse.threejs.org/t/deprecated-gamma-correction-alternative/57170 "2023-10-18T19:13:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trusiak](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/trusiak/32/10780_2.png) [@Trusiak](https://discourse.threejs.org/u/Trusiak)\
**Post date:** [October 18, 2023, 7:13pm UTC](https://discourse.threejs.org/t/deprecated-gamma-correction-alternative/57170/1 "2023-10-18T19:13:18Z")

</div>

i made a three.js version upgrade in my project. The problem is, in older version i used to `gammaOutput` and `gammaFactor` for appropriate gamma control like this:

```javascript
renderer.gammaOutput = true;
renderer.gammaFactor = 1.45;

```

Unfortunately since it has been marked as deprecated in the new version, I have no alternative.  
I tried using post process like this:

```javascript
 const gammaCorrectionPass = new ShaderPass(GammaCorrectionShader);
  composer.addPass(gammaCorrectionPass);

```

but unfortunately I don’t see a way to control the values here so that I can get the previous effect.  
So is there a way to control the gamma in the same way as I had in older versions of three.js?

---

<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:** [October 18, 2023, 8:03pm UTC](https://discourse.threejs.org/t/deprecated-gamma-correction-alternative/57170/2 "2023-10-18T20:03:46Z")

</div>

> [@Trusiak](#):
>
> So is there a way to control the gamma in the same way as I had in older versions of three.js?

No, this type of (variable) gamma correction does not exist anymore. Using `GammaCorrectionShader` applies a fix sRGB gamma correction but there is no `factor` uniform. Consider to write a custom shader and then use it in combination with `ShaderPass`.

Question: What is your use case `gammaFactor`? If your are using it to control exposure, would using linear tone mapping be an option? This process can be controlled via `toneMappingExposure`.

---

<div class="post-metadata">

**Author:** ![Trusiak](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/trusiak/32/10780_2.png) [@Trusiak](https://discourse.threejs.org/u/Trusiak)\
**Post date:** [October 19, 2023, 6:01pm UTC](https://discourse.threejs.org/t/deprecated-gamma-correction-alternative/57170/3 "2023-10-19T18:01:59Z")

</div>

before i used linear tone mapping too:

```javascript
this.renderer.outputEncoding = THREE.GammaEncoding;
this.renderer.toneMapping = THREE.LinearToneMapping;
this.renderer.toneMappingExposure = 1.3;
this.renderer.gammaOutput = true;
this.renderer.gammaFactor = 1.45;

```

and the effect was:

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/9/8/98952e3da9aafe0e8a5d80c0e09f867ab3d4ae29.jpeg)

now scene with only linear tone mapping looks that:

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/3/7/37094c6ba9dc0671e959c5dbf4e49b40106fc168.jpeg)

i’ve tried many combinations with tone mapping, but unfortunately I’m not able to achieve as good results as above. ☹

---

<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:** [October 19, 2023, 9:14pm UTC](https://discourse.threejs.org/t/deprecated-gamma-correction-alternative/57170/4 "2023-10-19T21:14:01Z")

</div>

How about increasing the intensity of your lights?
