Unity Community


Results 1 to 13 of 13

  1. Posts
    50

    A subwindow for the second camera view

    Some games are able to simultaneously display multipe camera views in one the main game window.

    How to create a subwindow for the second camera view as shown above?

    -Kaya


  2. Location
    Zürich, Switzerland
    Posts
    26,572
    Depends on. if it is meant to be a real window then you require unity pro and use render textures.

    if you just want to define a subarea of the screen where it shows, check out the normalized view rect on the camera


  3. Posts
    50
    Thank you dreamora.

    I am a beginner and I do have Unity 3.1 Pro.
    Is there a way to render the second camera view into a texture?



  4. Location
    Zürich, Switzerland
    Posts
    26,572
    Thats exactly what you would do with a RenderTexture yes

    You can create one with the create button in the project window and then just assign it to the target texture slot in the camera


  5. Posts
    242
    RenderTexture looks like a powerful tool, but can't this just be done with an extra camera limited to the top right corner of the screen?

    Create another camera. In the inspector take a look at "Normalized View Port Rect", and change the values to this:
    X: 0.7 Y:0.7 W:0.3 H:0.3 This will place the new camera window on the top right of the screen.

    Make sure you remove the component Audio Listener from the new camera, as there should be only one in a scene.

    Correct me if I'm wrong, I'm still a beginner with this Unity stuff


  6. Posts
    50
    Thank you legend411 for the link.. Ffollowing your link, I've managed to create Render Texture and assigned on to a cube that shows the second camera view. Likewise by assigning the Render Texture to a GUI Texture I can see the secondary camera view at a desired location on the screen.

    Thank you Puppeteer for your message. I couldn't figureout yet how to use "Normalized View Port Rect" to get multiple camera views.I am novice Unity user. I would appreciate if you can elaborate your method.


  7. Posts
    2,857
    Just FYI, the effect shown in the screenshot can almost certainly be done using multiple cameras only with no render-to-texture (as Puppeteer suggested). For that particular effect, you would most likely simply need to create a second camera, position and orient it appropriately, set its depth appropriately (to a value higher or lower than that of the depth of the other camera - can't remember which), and then set the normalized viewport rect appropriately (e.g. to something like x=.6, y=.6, w=.4, h=.4).

    I may have missed a detail or two in there, but that should be the basic idea.


  8. Posts
    242

    Step By Step

    Here's a Step-By-Step:

    First, Create a camera from the top menu bar by going to > GameObject > Create Other > Camera



    Now click on the newly created camera. A side window should open. This is the inspector, it is specific to each object you click on, so when you click on the camera, a window specific to all the functions in the camera will appear on the side.



    In the inspector take a look at Normalized View Port Rect, and change the values like in the picture. Finally, Disable the audio listener of this new camera ( the check box with a red circle around it ).

    Hope that helped.


  9. Posts
    50
    Thank you Jesse Anders and Puppeteer.
    Yes, I've followed your suggestions and managed to obtain two overlapping camera views as I was asking in my first message.
    One important trick is the Depth field. My main camera has Depth 0 and my second camera hust have Depth value larger than 0.
    I think RenderTexture is also very interesting function. I would like to tank you all for your help.


  10. Posts
    3
    I did in this way but error:colorSurf->width == depthSurf->width && colorSurf->height == depthSurf->height
    assert in file C:/BuildAgent/work/b0bcff80449a48aa/Runtime/GfxDevice/threaded/GfxDeviceClient.cpp Line: 1611)
    why?
    Last edited by HsmBoy; 08-03-2012 at 06:16 AM. Reason: plus


  11. Posts
    4
    Thank you a lot, it worked for me!!


  12. Posts
    1
    Hello
    thank you a lot, but if you make a simple project with a small pdf ebook that get very better than now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •