Skip to content

Supporting colorManagement=true #83

@mrxz

Description

@mrxz

The environments of this component look very washed out when enabling colorManagement. This was already raised in #49 but closed as the color space and gamma handling of A-Frame itself was subject to change. Now that we have colorManagement it would be nice if this component properly supports this.

There are various elements in an environment. In short:

  • The sky shaders don't do any encoding (for better or for worse) so are unaffected by the colorManagement
  • The ground uses two textures (map and emissiveMap) which can be set to THREE.sRGBEncoding
  • The dressing material color needs to be converted
  • The colors of the lights are automatically handles as those are core built-in A-Frame components that handle colorManagement

So effectively, only the ground textures and dressing material color require code changes. Which I attempted here (https://github.com/mrxz/aframe-environment-component/tree/color-management). There will be small visual differences since lighting calculations now happen in linear space, but it should no longer be washed out:

Before (no colorManagement) Before (colorManagement) After (colorManagement)
image image image

There are, however, environment presets that differ more:

Before After
image image

This is caused by the usage of emissive textures. The 'blending' of the diffuse color with the emissive color now (correctly) happens linearly and is afterwards encoded into sRGB. But as a result it retains more of its brightness compared to (naively) blending the two colors in sRGB space.

Sadly there is no way to ensure all presets will appear identical with colorManagement on or off. Especially the emissive textures result in quite distinct differences. Nevertheless I think it's an improvement over the washed out look and the changes have zero impact in case colorManagement is not enabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions