Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Question How to display Main camera and Secondary camera feeds on two separate textures?

Discussion in 'Unity Render Streaming' started by Pixionrevolution, Jan 3, 2023.

  1. Pixionrevolution

    Pixionrevolution

    Joined:
    Feb 2, 2017
    Posts:
    5
    I'd like to be able to see both feeds at the same time on two different RenderTextures but I don't understand how to select the VideoTrack for each Video Stream Receiver. Thanks in advance!
     
    Number-3434 likes this.
  2. Number-3434

    Number-3434

    Joined:
    Dec 31, 2022
    Posts:
    13
    Are you wanting them to overlay each other, or seperate?
     
  3. Number-3434

    Number-3434

    Joined:
    Dec 31, 2022
    Posts:
    13
    If you want to overlay them, set the top camera's depth to 1 and the main other camera's depth to 0.

    You can use the Viewpoint Rect values to change where your cameras render on the screen.
     
  4. Pixionrevolution

    Pixionrevolution

    Joined:
    Feb 2, 2017
    Posts:
    5
    Thanks for your answer.
    In my broadcasting scene I have two cameras, each of those is filming something specific and is streaming properly (I can see both views in the Web Video Player).
    In my receiving scene I have two different rendertextures.
    I would like the MainCamera video feed to be displayed on Rendertexture1 and the SecondaryCamera feed to be displayed on Rendertexture2.
     
  5. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    803
    Thank for your feedback.
    We made a ticket last year to solve the issue like you said.
    https://github.com/Unity-Technologies/UnityRenderStreaming/issues/641
     
    Pixionrevolution likes this.