EffectComposer changes the color of the background #436
-
I noticed in the example of I couldn't find any workaround to preserve the background color nor any documentation that mentions this. Would appreciate if I can get some direction / workaround to fix this. The demo below is a slight modification from the example at screen-recording.mp4 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Solved it! After messing about with color spaces and gamma correction, I figured out that the scene should be updated to use Linear color space workflow(also mentioned in the documentation). Make sure to make this encoding change for the textures as well. The code now looks like this: <Canvas camera={{ position: [0, 0, 3] }} linear> {/* notice the linear prop here */}
<color attach="background" args={["#6ddad0"]} />
<Suspense fallback={<Html center>Loading.</Html>}>
<Scene />
</Suspense>
<EffectComposer>
<DepthOfField
focusDistance={0}
focalLength={0.02}
bokehScale={2}
height={480}
/>
</EffectComposer>
</Canvas> |
Beta Was this translation helpful? Give feedback.
Solved it! After messing about with color spaces and gamma correction, I figured out that the scene should be updated to use Linear color space workflow(also mentioned in the documentation). Make sure to make this encoding change for the textures as well.
The code now looks like this: