aframevr / aframe

:a: Web framework for building virtual reality experiences.
https://aframe.io/
MIT License
16.69k stars 3.98k forks source link

Color Management changes in THREE #5302

Open dmarcos opened 1 year ago

dmarcos commented 1 year ago

I've seen changes landing on THREE lately related to color management that seemed change A-Frame default behavior

A-Frame 1.4.2 on THREE r147

image

A-Frame master on THREE r152

image

@donmccurdy Sorry to bother. I went through the changelog. There are tons of changes and couldn't make it complete sense. Do you have a quick summary of the changes we have to do to get the same results than r147? Thanks so much

donmccurdy commented 1 year ago

Hi @dmarcos! This summary is worth a look, if you haven't read it yet:

https://discourse.threejs.org/t/updates-to-color-management-in-three-js-r152/50791

At a glance, it looks like the "environment" component might need some updates, as described in https://github.com/supermedium/aframe-environment-component/issues/83. Are there other issues you're seeing outside the environment? If that's the main thing, I can take a closer look there...

Setting renderer="colorManagement: false;" appears to get you back to the r147 behavior in r152, but that's more of a temporary workaround than a solution.

dmarcos commented 1 year ago

Thanks for getting back so quickly. I just skimmed through the thread. Still so much for me to learn he he. I was writing a component and handling textures manually and learned I have to do:

texture.colorSpace = THREE.SRGBColorSpace;

We are doing that automatically already for the built-in materials

For the environment component I have to spend more time. Thanks so much.

mrxz commented 1 year ago

@dmarcos While setting texture.colorSpace manually works, you could consider calling rendererSystem.applyColorCorrection(texture) from your component instead. That way the component will work correctly with older versions (<= 1.4.2) as well.

As for the aframe-environment-component, I've updated the PR for https://github.com/supermedium/aframe-environment-component/issues/83 as some additional changes were needed for aframe-master.