Search Unity

HDR Render Texture downsampling not working on iOS Retina Devices - Unity 5

Discussion in 'General Graphics' started by ysalmi, Aug 28, 2015.

  1. ysalmi

    ysalmi

    Joined:
    Jan 25, 2013
    Posts:
    20
    When downsampling Render Textures in Unity 5 leads to very pixelated images on iOS Retina devices when using HDR. The picture below shows the issue in our game using the standard Bloom post-process effect. The left side shows the render output in Unity 4, the right side the very pixelated output in Unity 5 of the downsampled bloom textures.

    sshot1.png

    The problems appears when you downsample a render texture with the format ARGBHalf (aka RenderTextureFormat.DefaultHDR). It seems like it is rendering the texture with point filtering instead of the default bilinear filtering. Explicitly setting Bilinear filtering does not fix this.

    Below is sample code to reproduce this behavior:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class Resolution : MonoBehaviour
    5. {
    6.     void Start ()
    7.     {
    8.         //ARGBHalf leads to a very pixelated image
    9.         test = new RenderTexture(Screen.width / 8, Screen.height / 8, 0, RenderTextureFormat.DefaultHDR);
    10.         Debug.Log (RenderTextureFormat.DefaultHDR);
    11.     }
    12.  
    13.     RenderTexture test;
    14.  
    15.  
    16.     void OnRenderImage(RenderTexture source, RenderTexture dest)
    17.     {
    18.         Graphics.Blit(source, test);
    19.         Graphics.Blit(test, dest);
    20.     }
    21. }
    And this is what it looks like in Unity 4(on the left side) and Unity 5 (on the right side):

    sshot2.png

    This problem does not occur in the editor, but appears on iOS hardware (tested on an iPad 3 and an iPhone 6). We appreciate any help or suggestions or repros on this topic. We think some weird combination of HDR, texture size and mobile shader is causing this weird case but we can't seem to find a solution.
     
  2. ysalmi

    ysalmi

    Joined:
    Jan 25, 2013
    Posts:
    20
    Here's a super-simple project illustrating the issue. Looks fine on PC, oddly pixelated on iOS. If someone could confirm they are experiencing the same issue, it would be greatly appreciated.
     

    Attached Files:

  3. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    May want to submit a bug report with the file you attached above.
    Will most likely get more direct attention.
     
  4. ysalmi

    ysalmi

    Joined:
    Jan 25, 2013
    Posts:
    20
  5. ysalmi

    ysalmi

    Joined:
    Jan 25, 2013
    Posts:
    20
    We've just been told that this issue is fixed in the upcoming 5.2 release. Thanks for the help.
     
    theANMATOR2b likes this.