Search Unity

Rendertexture on camera works in editor, always black on Android / GearVR 5.6.3pq

Discussion in 'General Graphics' started by quitebuttery, Aug 22, 2017.

  1. quitebuttery

    quitebuttery

    Joined:
    Mar 12, 2011
    Posts:
    329
    Are there any caveats I should know about when using rendertexture on cameras for Android / GearVR?

    I'm using an extra camera with a rendertexture on it so I can sample the texture to compute its average color.

    In the editor this works fine, but on device (Galaxy S7-8 GearVR) the texture is always black.

    Are there any platform specific issues with rendertexture and Android? Like maybe minimum texture sizes or formats I need to use etc. ?
     
  2. quitebuttery

    quitebuttery

    Joined:
    Mar 12, 2011
    Posts:
    329
    For those playing along at home. This is fixed! The issue is I had "don't clear" on the camera that output to the rendertexture. (Figured it was good for performance) Apparently, on device this causes the camera to output black. I set it to "clear color" and now it works fine.
     
    ElasticSea and pocoster like this.
  3. fbbgo

    fbbgo

    Joined:
    Oct 14, 2014
    Posts:
    20
    well done.
     
  4. VrGamesDev

    VrGamesDev

    Joined:
    May 7, 2018
    Posts:
    65
    Hello, Sorry for the bump, I have this exact same issue, I can't find the "don't clear" on the camera.
     
  5. renderist

    renderist

    Joined:
    May 31, 2017
    Posts:
    2
    It's an option under Clear Flags on the Camera component -
    upload_2020-4-22_17-29-47.png
     
  6. VrGamesDev

    VrGamesDev

    Joined:
    May 7, 2018
    Posts:
    65
    thank you, the "clear color" is "solid color"