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

[Resolved] Render Texture issue on iPhone

Discussion in 'Image Effects' started by C-Gabriel, Dec 9, 2018.

  1. C-Gabriel

    C-Gabriel

    Joined:
    Jan 27, 2016
    Posts:
    119
    Hey,

    I am trying to generate a heightmap by rendering some stuff with replacement shader into an ARGB32 render texture. I am using EncodeFloatRGBA / DecodeFloatRGBA to have as much precision as possible within the 0-1 range. After that, I compute the normal map and add the reflections. The issue is that it looks perfect in the Editor (both windows and mac) as well as in the XCode simulator, but not on the device itself. Here's a screenshot:
    upload_2018-12-9_12-18-1.png

    I've also tried to use R16 / R half / R float and get rid of EncodeFloatRGBA / DecodeFloatRGBA , but the result was the same

    It looks like the RT has some dithering / noise on the device, which screws the values. I've displayed the RT raw values and that seems to be the case indeed.
    Sorry for not being able to give more info, but the XCode > Capture GPU Frame feature stopped working after upgrading to iOS 12.1
    issue here: https://forum.unity.com/threads/xcode-capture-gpu-frame-not-working-anymore-ios12-1.595288/

    system details:
    iOS 12.1
    XCode Version 10.1 (10B61)
    macOS High Sierra 10.13.6
    Unity 2018.3.0.f1
     

    Attached Files:

  2. C-Gabriel

    C-Gabriel

    Joined:
    Jan 27, 2016
    Posts:
    119
    After fixing the GPU debugger, I'm convinced the issue is that the render texture has some noise on the device, whereas on the other platforms, it doesn't. EncodeFloatRGBA / DecodeFloatRGBA are useless if there is some random noise on top

    Here's a screenshot with ddx and ddy to see a comparison
    upload_2018-12-9_16-47-28.png
     
  3. C-Gabriel

    C-Gabriel

    Joined:
    Jan 27, 2016
    Posts:
    119
    Resolved: it was a precision issue in my replacement shader. I had to use float instead of half.
     
  4. finalsola

    finalsola

    Joined:
    Jan 31, 2018
    Posts:
    1