Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    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:
    923
    @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:
    923
    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:
    923
    Better than nothing... thanks for the update!
     
unityunity