Search Unity

Custom Shape Camera View

Discussion in 'Scripting' started by akgdeen, Apr 17, 2012.

  1. akgdeen

    akgdeen

    Joined:
    Dec 8, 2011
    Posts:
    81
    Hi,

    Can we make the camera view port in Rounded Rectangle instead of default rectangle?

    I wanted to make the secondary camera view as rounded rectangle.

    Thanks
     
  2. Sh_Black_Hole

    Sh_Black_Hole

    Joined:
    May 22, 2011
    Posts:
    40
    I think u can :
    1- make cube in child of your camera.
    2- make Rounded Rectangle texture with alpha layer.
    3- change shader of cube to some transparent shader.
    4- maybe it's better write some script for you camera that reposition you filter (cube) in right place ( a little far from near of clipping planes ) and resize filter by FOV.

    in this way u can make any shape for your camera view port by change your filter texture.
     
  3. akgdeen

    akgdeen

    Joined:
    Dec 8, 2011
    Posts:
    81
    Thanks for the tip, let me try out
     
  4. Marrt

    Marrt

    Joined:
    Feb 7, 2012
    Posts:
    613
    It is shown in this Video:
    http://www.youtube.com/watch?v=iTNnWVolRLk

    i made heavy usage of this in my game (splitscreen):
    (press RMB and move cursor to make splitscreen appear)
    http://marrt.site11.com/

    but when it comes to add skyboxes and stuff it starts to get messy with splitscreens, i use 6 cameras to achieve the effect in my game.
    Ship and Reticle have each 1 for visible area, 1 for dark area , 1 for the skybox. and they all have different culling masks and camera depths
     
    Last edited: Apr 18, 2012
  5. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749