# Gamma and contrast adjustment

**URL:** <https://discourse.threejs.org/t/gamma-and-contrast-adjustment/29372>\
**Category:** Questions\
**Tags:** materials, shaders\
**Created:** [August 29, 2021, 1:07pm UTC](https://discourse.threejs.org/t/gamma-and-contrast-adjustment/29372 "2021-08-29T13:07:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![11170](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/11170/32/19563_2.png) [@11170](https://discourse.threejs.org/u/11170)\
**Post date:** [August 29, 2021, 1:07pm UTC](https://discourse.threejs.org/t/gamma-and-contrast-adjustment/29372/1 "2021-08-29T13:07:01Z")

</div>

I am implementing various effects these days.  
When the effects are added, it becomes too bright.  
I want to adjust the gamma, contrast, etc of the renderer as a whole.  
Please tell me the easy and simple way.

 ![effect additive](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/6/5/65e68ea0efc4fe9a89e0cd66817ede58653c3a41.png)

---

<div class="post-metadata">

**Author:** ![Chaser\_Code](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/chaser_code/32/20199_2.png) [@Chaser\_Code](https://discourse.threejs.org/u/Chaser_Code)\
**Post date:** [August 29, 2021, 1:45pm UTC](https://discourse.threejs.org/t/gamma-and-contrast-adjustment/29372/2 "2021-08-29T13:45:34Z")

</div>

[https://threejs.org/examples/webgl\_postprocessing\_nodes.html](https://threejs.org/examples/webgl_postprocessing_nodes.html)  
[https://threejs.org/examples/webgl\_postprocessing\_nodes\_pass.html](https://threejs.org/examples/webgl_postprocessing_nodes_pass.html)

---

<div class="post-metadata">

**Author:** ![11170](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/11170/32/19563_2.png) [@11170](https://discourse.threejs.org/u/11170)\
**Post date:** [August 30, 2021, 1:42am UTC](https://discourse.threejs.org/t/gamma-and-contrast-adjustment/29372/3 "2021-08-30T01:42:12Z")

</div>

Thank you for your kind reply.  
Can you tell me how to adjust the gamma value?  
When I made the effect, it seems that the gamma value is too large.

---

<div class="post-metadata">

**Author:** ![Chaser\_Code](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/chaser_code/32/20199_2.png) [@Chaser\_Code](https://discourse.threejs.org/u/Chaser_Code)\
**Post date:** [August 30, 2021, 5:06am UTC](https://discourse.threejs.org/t/gamma-and-contrast-adjustment/29372/4 "2021-08-30T05:06:41Z")

</div>

Three.js says “.gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.”

---

<div class="post-metadata">

**Author:** ![11170](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/11170/32/19563_2.png) [@11170](https://discourse.threejs.org/u/11170)\
**Post date:** [August 30, 2021, 8:32am UTC](https://discourse.threejs.org/t/gamma-and-contrast-adjustment/29372/5 "2021-08-30T08:32:38Z")

</div>

I found the items below in the textures.  
But there doesn’t seem to be an option to lower the gamma value.

### .encoding : number

THREE.LinearEncoding is the default. See the texture constants page for details of other formats.

---

<div class="post-metadata">

**Author:** ![Chaser\_Code](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/chaser_code/32/20199_2.png) [@Chaser\_Code](https://discourse.threejs.org/u/Chaser_Code)\
**Post date:** [August 30, 2021, 8:47am UTC](https://discourse.threejs.org/t/gamma-and-contrast-adjustment/29372/6 "2021-08-30T08:47:59Z")

</div>

I found only this: [Canonical gamma correction since r112](https://discourse.threejs.org/t/canonical-gamma-correction-since-r112/11756)  
Maybe need to add code in the bottom of fragment shader of material.  
`gl_FragColor.rgb=pow(gl_FragColor.rgb,vec3(1.4));`

---

<div class="post-metadata">

**Author:** ![11170](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/11170/32/19563_2.png) [@11170](https://discourse.threejs.org/u/11170)\
**Post date:** [August 31, 2021, 1:37am UTC](https://discourse.threejs.org/t/gamma-and-contrast-adjustment/29372/7 "2021-08-31T01:37:11Z")

</div>

Thank you for your kind reply. I tried adjusting the gamma, but it didn’t come out the color I wanted.  
I plan to adjust the color over time.

---

<div class="post-metadata">

**Author:** ![11170](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/11170/32/19563_2.png) [@11170](https://discourse.threejs.org/u/11170)\
**Post date:** [August 31, 2021, 1:18pm UTC](https://discourse.threejs.org/t/gamma-and-contrast-adjustment/29372/8 "2021-08-31T13:18:01Z")

</div>

Gamma was adjusted, but the result was not as good as expected.  
I chose to adjust the vibrance and sataturation values.  
 ![before](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/1/a/1a33e6423151f41b550390708aab834f1ace1194.jpeg)  
 ![befofff](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/a/f/afcad3c8693d9d8f35c76a703c0c433274b08fb3.png)
