I am confused how color management, the output colorspace and post-processing with EffectComposer is supposed to work. I have gone through the documentation, and the behavior does not match what I was expecting based on the documentation.
I would like to ask for your help to improve my understanding, and maybe to identify whether the documentation can be clarified in some points.
I have created a minimal working example that showcases / experiments with some rendering settings. The fiddle runs different renderers in parallel with a simple emissive material (to keep it extremely simple). Currently the selected color is a bright orange: #f58231 Color Hex
I would expect some colorspace settings to reproduce the hex color correctly (i.e. sRGB in - sRGB out) and some not, but the current outcome is different than I expected. Below are the specific parts that I am confused about.
OutputPass has no effect
As you can see in the fiddle, adding an OutputPass
as the last pass in the EffectComposer
has no effect. The displayed color remains the same whether using RenderPass
only, or RenderPass + OutputPass
, independently of the colorspace used in the renderer. I was expecting to need the OutputPass
to convert from linear colorspace to sRGB.
The manual states (under Workflow):
OutputPass
is usually the last pass in the chain which performs sRGB color space conversion and tone mapping.
But the OutputPass
seems to do literally nothing (if I’m not using tone mapping):
- If the renderer colorspace is set to
LinearSRGBColorSpace
, the output color is wrong (i.e. not converted to sRGB) regardless of whetherOutputPass
is present. - If the renderer colorspace is set to
SRGBColorSpace
, then the colors are displayed correctly, but this is even the case withoutOutputPass
, so what is it for?
What is the correct colorspace and post-processing chain?
The older color management migration guide states:
If using three.js-provided post-processing (not pmndrs/postprocessing), set renderer.outputColorSpace = THREE.LinearSRGBColorSpace and enable a GammaCorrectionShader pass.
But this clearly results in the wrong color as seen in the fiddle. Note that GammaCorrectionShader
has been superseded by the OutputPass
, but is this migration step now wrong?
In the current manual I cannot find much about what colorspace to use with post-processing, and whether the OutputPass
is always necessary or not.
The color management manual states only:
Output to a display device, image, or video may involve conversion from the open domain Linear-sRGB working color space to another color space. This conversion may be performed in the main render pass (WebGLRenderer.outputColorSpace), or during post-processing.
renderer.outputColorSpace = THREE.SRGBColorSpace; // optional with post-processing
Why does the manual say “optional with post-processing”? Since SRGBColorSpace
is the default for the renderer anyway, setting it is clearly also optional without post-processing.
Many thanks for improving my understanding on this topic!