Search Issue Tracker

Fixed in 2018.2



Found in




Issue ID




[Regression] [Win] Videos are dark when using Linear color space

Graphics - General


How to reproduce:
1. Download attached project file and open "1" Scene
2. Enter Play Mode (make sure Linear color space is selected in Player Settings)

Actual result: All videos are too dark when using the Linear color space. They are correct with the Gamma color space.

Reproduced with: 2017.1.2p2, 2017.2.0f3, 2017.3.0b6, 2018.1.0a1
Not reproduced with: 2017.1.2f1, 2017.2.b10, 2017.3.0a7

Regression since: 2017.1.2p1, 2017.2.0b11, 2017.3.0b1

Reproduced only with Windows.

Fixed in: 2018.2.0a6

Comments (18)

  1. 457a4318608d201f5a88c7706b489dd5?d=mm


    Feb 17, 2020 19:59

    Unlit/Transparant at material/Shader may work fine!

  2. 3b03d455940ab6d67b904f95e9cfcd2d?d=mm


    Jul 05, 2018 17:54

    I applied RATT's fix and it works well with the Video Player Component in 2017.4.1f1.If you want a simple breakdown:

    - In Project Window: Create > Shader > Unlit Shader

    - Underneath the line: fixed4 col = tex2D(_MainTex, i.uv);
    add the following line:
    col.rgb = LinearToGammaSpace(col.rgb);

    - Create a new material: Create > Material
    - Select the new Shader
    - Drag that Material onto the GameObject where your Video Player Component is.
    - Enjoy life!

    Remember that if you upgrade your project to 2018.2 or above in the future, you might need to swap the shader back to the default Unlit Shader.

  3. 040e156173ba5d6e7fa458011862611e?d=mm


    Apr 30, 2018 13:35

    ergh, I meant "private RenderTexture myRTTarget;" OFC, but couldn't modify the comment once it was posted in an "oh no second" :)

  4. 040e156173ba5d6e7fa458011862611e?d=mm


    Apr 30, 2018 13:33

    Mark-Davis Mar 20, 2018 22:37 <--- LIFE SAVER, THANKS!

    For all those who just want to copypaste, create a class level "private RenderTexture targetRT;", have your UI RawImage ready, then in Awake()

    RenderTextureDescriptor rtDesc = new RenderTextureDescriptor([int_vidclip_width], [int_vidclip_height], RenderTextureFormat.Default, 24);
    rtDesc.sRGB = false; //Thank this to Mark Davis! :)
    myRTTarget = new RenderTexture(rtDesc);
    [your_ui_rawimage].texture = myRTTarget;

    And when you want to play a clip:
    myVideoPlayer.targetTexture = myRTTarget;

    Tada, untested joke-engine bug million-th workaround applied!

  5. B965c3693288a27b20bf7b55e0527884?d=mm


    Mar 30, 2018 02:04

    FYI - This issue is definitely fixed in Unity 2018.1.0b12. I just upgraded from 2017.3 and had the dark videos, and they look great now.

  6. A2b30891a38bf4d9585bc369e07924ca?d=mm


    Mar 20, 2018 22:37

    Hey guys - I just ran into the same issue, but found a workaround. Maybe this will help someone.

    Try using a RenderTexture as the target. An easy way to handle this is to link the RenderTexture to a RawImage. When you create the RenderTexture, in the RenderTextureDescriptor,
    set: desc.sRGB = false;

    Good luck!

  7. Dccaf85fd3c8d88848779d5d279bb7e4?d=mm


    Mar 17, 2018 12:11

    The issue still exists in 2017.3.1f1 please fix asap.

  8. 996f99c08d9c20a86b1bb2e72b167bc6?d=mm


    Mar 16, 2018 11:14

    Still exists in 2017.2.1f1

  9. 3f3d2dd908207b795e6f18f3de6e0fff?d=mm


    Mar 12, 2018 14:01

    Tried both workaround but on dark areas, there are bad artifacts and you can clearly see the difference in quality if you play the video outside of unity.
    Any idea if this will be fixed soon or if there is a better workaround?

  10. Bc2cbb3ace9601f01f34dd28340d3113?d=mm


    Mar 05, 2018 22:33

    We ran into the same issue, we fixed it by making a custom shader based on the default Unity UI shader.

    We added:

    fixed4 col = tex2D(_MainTex, i.uv); //this is the line before, should be in the shader
    col.rgb = LinearToGammaSpace(col.rgb); //this is the line we added

    And then make a material with that, put it as the material for the VideoPlayer and you should be good to go

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.