Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

sRGB conversion neglected for color material override in Hybrid Renderer V2

Discussion in 'Graphics for ECS' started by paradoxical-jay, Nov 8, 2020.

  1. paradoxical-jay

    paradoxical-jay

    Joined:
    Jan 28, 2020
    Posts:
    8
    In editor I see this (intended colors):

    upload_2020-11-8_11-59-23.png

    Running the game, I see this (spheres have become brighter):

    upload_2020-11-8_11-59-53.png

    These are game objects converted to entities via ConvertToEntity component. The two spheres have a MaterialOverride component to override _BaseColor, which appears to circumvent sRGB->linear conversion when processed by Hybrid Renderer V2. The numeric RGB values observed in the instance compute buffer using a GPU debugger support this explanation - values for the spheres match the in-editor color picker exactly, whereas the cubes' RGB has been gamma corrected.

    Known issue?
     
  2. joelv

    joelv

    Unity Technologies

    Joined:
    Mar 20, 2015
    Posts:
    203
    How is this converted? We have a path in the material conversion that should convert material and material property block colors to linear.

    If you do your own conversion you need to ensure any colors are put in the correct color space. Hybrid renderer will just do a copy of the data put in the component and allow you to access that on the GPU. Without conversion. We talked about adding automatic conversion but the interface turns out less than optimal to say the least. What we potentially can to is to add a color property or color component or similar which would allow you to assign .linear and .gamma similar to the component and it would do the appropriate conversion (in C#).
     
  3. paradoxical-jay

    paradoxical-jay

    Joined:
    Jan 28, 2020
    Posts:
    8
    I'm using plain ConvertToEntity component on my gameobjects. The anomalous colors are coming from MaterialOverride component. No custom conversion. I would think that any color specified in Material Override Asset would be assumed to be sRGB space unless otherwise specified (somehow).
     
  4. joelv

    joelv

    Unity Technologies

    Joined:
    Mar 20, 2015
    Posts:
    203
    I would also expect this to work, yes.
    Can you report a bug on this with the repro scene you pictured above so we can look at it?