# How to support any output encoding/colorSpace with RawShaderMaterial?

**URL:** <https://discourse.threejs.org/t/how-to-support-any-output-encoding-colorspace-with-rawshadermaterial/52781>\
**Category:** Questions\
**Tags:** color-space, materials\
**Created:** [June 13, 2023, 9:06pm UTC](https://discourse.threejs.org/t/how-to-support-any-output-encoding-colorspace-with-rawshadermaterial/52781 "2023-06-13T21:06:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jtbandes](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/jtbandes/32/28741_2.png) [@jtbandes](https://discourse.threejs.org/u/jtbandes)\
**Post date:** [June 13, 2023, 9:06pm UTC](https://discourse.threejs.org/t/how-to-support-any-output-encoding-colorspace-with-rawshadermaterial/52781/1 "2023-06-13T21:06:46Z")

</div>

In [three-text](https://github.com/foxglove/three-text/blob/45657e532f03bc97a23e7f40b4ee603598e842da/src/LabelPool.ts) I’ve been using a `RawShaderMaterial` with a color as an input uniform. In the vertex shader I use `LinearTosRGB` (from `encodings_pars_fragment`) to ensure the output is in the sRGB color space.

Is there a way to respond dynamically to the output color space when using RawShaderMaterial, so that it works with any output color space? Something like [`linearToOutputTexel`](https://github.com/mrdoob/three.js/blob/dc4d8354698177a5f9333ba26771fccfa9b1dfcd/src/renderers/webgl/WebGLProgram.js#L782), but accessible from my custom RawShaderMaterial subclass?
