Search Unity

Question Display Render Texture in other tab?

Discussion in 'Web' started by JudahMantell, Feb 13, 2023.

  1. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    Hey all! I want to add a feature where a user can choose to output a unity camera (a render texture) to be visible in another browser tab, updating the view in realtime. This would be to mimic having an extra display for filmmaking applications, and allow for easy screen recording while running on WebGL.

    I see that you can pass a texture back and forth between the JsLib and the c# script, but I'm not sure exactly how. Is this something that's doable?
    If so, does anyone have any pointers (heh) on how to make this happen?

    Thanks so much!
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,427
    unity has render streaming/webrtc plugin, if it works in webgl then that could work.

    or to test proof of concept:
    save texture on server (upload)
    2nd tab loads that texture from server..(every x seconds)

    or test that passing image data to javascript,
    and find some js library that streams video or data out. (probably more options in javascript, than unity webgl)
     
    JudahMantell likes this.
  3. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    Thanks for the suggestions, I'll look into those!
    That being said, my goal is to be as clean as possible without extra plugins and such.

    If there was a way to do this directly using JsLib plugins and pass the native texture to the javascript that would be ideal.
     
    Last edited: Feb 13, 2023
  4. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,427
    JudahMantell likes this.