Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

2017.2.0 Linear color space and vieport rect problem

Discussion in 'WebGL' started by r3dwolf, Oct 9, 2017.

  1. r3dwolf

    r3dwolf

    Joined:
    Feb 16, 2012
    Posts:
    39
    Hello,
    I set the viewport rect of a camera to value other than the default.
    Code (CSharp):
    1. cam.rect = new Rect (0, 0.35f, 1, 0.65f);
    In the editor everithing works well and also with a build with gamma color space:
    upload_2017-10-9_13-53-34.png

    if instead the build is in linear color space, the viewport is deformed:
    upload_2017-10-9_13-53-58.png


    Did anyone have the same problem? is there a workaround?
     
  2. r3dwolf

    r3dwolf

    Joined:
    Feb 16, 2012
    Posts:
    39
  3. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    936
    @Marco-Trivellato is there any workaround for this problem?

    Thanks in advance for the support!
     
  4. Vapid-Linus

    Vapid-Linus

    Joined:
    Aug 6, 2013
    Posts:
    64
    I'm also having this problem and it is preventing me from creating a WebGL app that always covers the entire window when using linear lighting.

    @Marco-Trivellato
     
    kenshin likes this.
  5. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    No known workaround at this time. Perhaps you can try to render your scene to texture, then copy the image to the current camera
     
  6. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    936
    Thanks Marco.
    Do you think this bug will be fixed soon?
    For us is a big problem that prevent to use linear render on webgl :(
     
  7. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    To be honest, I don't think so.
    However, the good news is that you should be able to workaround it by disabling HDR and Anti-Aliasing.
     
    kenshin likes this.
  8. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    936
    Better than nothing... thanks for the update!