Search Unity

Android vs Windows portal problem

Discussion in 'General Graphics' started by kevin_rmucan, Jun 8, 2020.

  1. kevin_rmucan

    kevin_rmucan

    Joined:
    Jan 7, 2020
    Posts:
    2
    Hello,

    I created a portal effect by following
    and I am trying to recreate it in an AR project with AR Foundation (mostly copy pasting the code I need from the github project provided in the description of the youtube video, github: https://github.com/SebLague/Portals/tree/master).
    The portal works great on windows, but once I switch to Android platform, all the objects with standard shader and render queue opaque aren't visible anymore in the portal. However the skybox and objects with standard shader and render queue transparent are still visible.

    I have no idea why this is happening. If anyone has a clue, please let me know. If you need more specific information, I will try to provide. But all code can be found on the github link. (Assets/Scripts/Core)

    Here are some pictures to show what is happening:
    For windows (still run inside the editor)

    For android (the build as well running it in the editor gives same result)



    Thank you for your time.
     

    Attached Files:

    Last edited: Jun 8, 2020
  2. kevin_rmucan

    kevin_rmucan

    Joined:
    Jan 7, 2020
    Posts:
    2
    I found the problem after many many hours. My render texture didn't have any depth. Setting the depth to 16 fixed the issue.
     
  3. DonHaul

    DonHaul

    Joined:
    Mar 3, 2014
    Posts:
    3
    Solution is in here: https://answers.unity.com/questions/1012048/how-do-i-change-the-render-queue.html

    Pretty much, for every material that you want to see on the portal, it has to be have the renderqueue transparent (3000)+1. Has somethign to do with the order unity renders stuff

    Doing
    Code (CSharp):
    1. GetComponent<MeshRenderer>().sharedMaterial.renderQueue = 3001;
    on the object with the issue solved it for me.