Search Unity

All Canvas's become invisible when using Render Texture on two

Discussion in 'VR' started by burkeda0300, Aug 13, 2018.

  1. burkeda0300

    burkeda0300

    Joined:
    Mar 2, 2017
    Posts:
    7
    Hi All,

    Problem: In one scene within my project we are using a world space canvas to display interactable UI. When running through the editor we have no issues, however, when we build the project, all UI canvas's become invisible, though with the use of a laser pointer we can still interact with buttons on the canvas.

    I've narrowed the cause down to the use of a specific render texture (only one), which is applied to the target texture of two (2) cameras in the scene. The two cameras are used to provide a live feed to a mesh of the view of a device in the scene.

    When I set the two cameras (neither are the main camera in the scene) target texture's to null, that is the only way which I can get the Canvas to appear.

    When after running a build I always check the output_log.txt file and have not found any errors.


    We are using:
    Unity 2018.1.3f1
    VRTK 3.3.0a
    Steam VR w/HTC Vive
    Unity's Lightweight Render Pipeline
    Post Process layer

    There is only one canvas in the scene, with all UI objects as children of that object. Our Canvas set up:
    Note: I've set the VRTK_UI Canvas component to be inactive to check if that was the cause, and it was not.
    upload_2018-8-13_13-39-16.png




    Camera One:
    Note: I've tried clicking the "Fix now" under the target texture, with no change or improvement
    upload_2018-8-13_13-34-46.png

    Camera 2:
    Note: I've tried clicking the "Fix now" under the target texture, with no change or improvement
    upload_2018-8-13_13-33-22.png

    Mesh we are Rendering to:
    upload_2018-8-13_13-36-44.png

    Render Texture:
    upload_2018-8-13_13-37-37.png
     
  2. burkeda0300

    burkeda0300

    Joined:
    Mar 2, 2017
    Posts:
    7
    Main Camera SetUp:
    upload_2018-8-13_13-45-22.png

     
  3. burkeda0300

    burkeda0300

    Joined:
    Mar 2, 2017
    Posts:
    7
    ****Update:** I've created a test scene where I've recreated the usage of a canvas with image and text, primitive game objects and the use of two cameras in addition to the Camera Rig, with target textures set to the same render texture. In this state, it worked, however when I installed and upgraded all materials to via the lightweight render pipeline, the render texture turned pink and would not render anything from the cameras. Considering this, my next step forward is to remove the lightweight render pipeline via reverting to a previous commit which does not have the lightweight render pipeline.* If you run into the same situation remember if you do not have a previous commit you can revert to, after removing the lightweight render pipeline you will need to create new materials for all your game objects.*
     
  4. burkeda0300

    burkeda0300

    Joined:
    Mar 2, 2017
    Posts:
    7
    The lightweight render pipeline was the issue, removing it allowed for everything to work as expected
     
  5. opamped

    opamped

    Joined:
    Oct 3, 2015
    Posts:
    6
    Hit this exact same issue. Unity 2018.2.7f1, lightweight pipeline 3.0.0, post process layer, OpenVR.

    All worldspace UI objects will toggle on/off along with the camera rendering directly to a render texture. I don't have a fix right now and will probably follow burkeda0300's example and revert to the standard pipeline. They're called 'Preview Packages' for a reason.

    Thanks for the detailed post. Saved me a good chunk of time isolating the issue.
     
  6. opamped

    opamped

    Joined:
    Oct 3, 2015
    Posts:
    6
    After a little testing, the issue persists independent of XR support and post processing. It does, however, seem to be resolved in the 2018.3 beta. This seems to hold even when using lightweight 3.0.0 instead of 3.3.0. A fix for 2018.2 would be nice as I'm not going to chance moving my current project to the beta but it's good to know there's progress.