Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to reduce the field of view on a camera for hololens 2

Discussion in 'VR' started by janimator, Jul 17, 2020.

  1. janimator

    janimator

    Joined:
    Apr 5, 2013
    Posts:
    52
    For the project I'm working I will be utilizing 2 cameras, one of which will need to have a smaller field of view ( crop the borders ).
    I have been having a tough time thinking of any viable solution for this.

    The end result would be as if the hololens 2 would had a smaller display space in both width and height. I dont want any of the objects in this camera to bleed out of this cropped space which will be utilized by the other camera.

    The only solution I can think of is to split the camera into two cameras, one for each eye. Then for each eye add an occlusion mesh to occluded the eyes view.
     
  2. janimator

    janimator

    Joined:
    Apr 5, 2013
    Posts:
    52
    Right now I'm trying to hopefully write a shader that will not draw pixels around the border of the display area. Does anyone have any very basic shader that works on Hololens camera to reference?
     
    Last edited: Jul 20, 2020
  3. j_sch

    j_sch

    Joined:
    Sep 10, 2015
    Posts:
    5
    Will drawing a black frame in a screen space canvas work?
     
  4. janimator

    janimator

    Joined:
    Apr 5, 2013
    Posts:
    52
    The problem is that its difficult to have a black frame that accommodates each eye correctly. If you think about it a single black frame right up to the right eyes might cover the left eye in an awkward way. For this to work a black frame would need to be so close to each eye that it is not visible to the other eye. This kind of goes again the recommended near clipping plane distance.

    If there is a magical and easy way of creating a black frame I would love to know.
     
  5. a-aman

    a-aman

    Joined:
    Apr 22, 2018
    Posts:
    4
    I don't get what you want to do in your project. But can you try to adjust the camera component. It has the field of view property.

     
  6. j_sch

    j_sch

    Joined:
    Sep 10, 2015
    Posts:
    5
    Maybe the left eye can have borders on the top, left, and bottom. The right eye can have borders on the top, right, and bottom. That way there are no borders in the middle. Just a thought.