Search Unity

Question Human segmentation texture offset from camera image

Discussion in 'AR' started by TropicalCyborg, Jun 17, 2021.

  1. TropicalCyborg

    TropicalCyborg

    Joined:
    Mar 19, 2014
    Posts:
    28
    I am trying to use the human segmentation texture2D generated by the Occlusion manager from XR foundation as an image alpha for a graph shader on a material used as a custom camera material. For some reason the image displays completely offset from the camera image. I've done some manipulations on the UV nodes and I've came up with something close to what I need. Maybe tweaking it carefully I will succeed but I am pretty sure that there maybe some simpler and more efficient way of doing it. Does someone have any suggestions?

     
  2. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,144
  3. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    A bit of a tip from the team:

    You need to look at the ARCameraBackground shader in ARFoundation and appropriately apply the display matrix received from the ARCameraFrameEventArgs to the texture.
     
    TropicalCyborg likes this.
  4. TropicalCyborg

    TropicalCyborg

    Joined:
    Mar 19, 2014
    Posts:
    28
    But how would I do it using Shader Graph? Is it possible?
     
  5. todds_unity

    todds_unity

    Joined:
    Aug 1, 2018
    Posts:
    324