# \[SOLVED\] sRGB/HDR color values in postprocessing fragment shaders

**URL:** <https://discourse.threejs.org/t/solved-srgb-hdr-color-values-in-postprocessing-fragment-shaders/34506>\
**Category:** Questions\
**Tags:** render-target, shaders\
**Created:** [February 4, 2022, 12:43pm UTC](https://discourse.threejs.org/t/solved-srgb-hdr-color-values-in-postprocessing-fragment-shaders/34506 "2022-02-04T12:43:44Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Harold](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/harold/32/32136_2.png) [@Harold](https://discourse.threejs.org/u/Harold)\
**Post date:** [February 4, 2022, 8:06pm UTC](https://discourse.threejs.org/t/solved-srgb-hdr-color-values-in-postprocessing-fragment-shaders/34506/3 "2022-02-04T20:06:33Z")

</div>

I think that did the trick! Thanks for the hint! 😄

To clarify the issue: I simply want “selective bloom” without having to render the scene multiple times. In my opinion, using `emissiveIntensity` on an object should produce “light”, and should therefore be affected by bloom.

So, _any_ object without an `emissiveIntensity` will not be affected by bloom effects, while any object with an `emissiveIntensity` higher than 0 will have bloom (the effect strengthens naturally the higher the intensity value).

For anyone stumbling across this:

My encoding on the renderer is set to sRGBEncoding.  
The framebuffer(s) in the swapchain are configured like so:

```javascript
const rtOptions: WebGLRenderTargetOptions = {
    type: FloatType,
    encoding: sRGBEncoding,
    minFilter: NearestFilter,
    magFilter: NearestFilter,
};

```

If you then (in your post-fx “feature generation” shader) pass the ambient light value of your scene, it’s as simple as subtracting `1.0 + ambientLightIntensity` from the final color so you’ll be left with all pixels from objects that have an `emissiveIntensity` value higher than 0.

---

_[View the full topic](https://discourse.threejs.org/t/solved-srgb-hdr-color-values-in-postprocessing-fragment-shaders/34506)._
