Search Unity

Crop a camera view in unity for HTC steamVR

Discussion in 'AR/VR (XR) Discussion' started by Seb1101, Sep 14, 2018.

  1. Seb1101

    Seb1101

    Joined:
    Aug 23, 2018
    Posts:
    2
    Hi all,

    I'm currently stuck on a pretty huge project.. Maybe I didn't search well enough but until now, I did not find any related topic that could solve my issue..

    I am trying to crop a sub-camera FOV in order to send it to the HTC headset.
    Briefly my camera is filming a background and I want a specific rectangle cropped out of this first camera view to be sent alone to the HTC headset.

    See the image as an example;
    The entire image would be the first camera FOV and the cropped rectangle (position/transf/rotation; adjustable) would be sent alone to the HTC with a black surrounding instead of the previous image surrounding. Like some kind of small window...


    Any ideas?
     

    Attached Files:

  2. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    What is the purpose of cropping ? You waste power rendering the whole image.

    Why not zoom the game VR camera and position it to render the rectangle you want ?
     
  3. Seb1101

    Seb1101

    Joined:
    Aug 23, 2018
    Posts:
    2
    Thank you for your answer,

    The thing is I don't really want to zoom, I want a part (cropped, call it how you want) of the original image to be alone sent to the player's (VR's) view. The rest would be black or unseeable.

    In this way only a little square or rectangle would be visible in the field of view of the player.

    I tried using a mirror texture on a plane and displacing this plane wherever I want on the field of view of the player. Then adding a Layer so that the VR camera only sees this texture seems to make the job. However I don't think it's the best solution..