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

How to render an image onto the far plane of main camera?

Discussion in 'Editor & General Support' started by archie1983, Jun 20, 2022.

  1. archie1983

    archie1983

    Joined:
    Sep 29, 2021
    Posts:
    2
    Hi all,
    So, I'd like to render (and re-render later) a single jpeg image from a byte buffer onto the main camera, but I want the other components of the scene remain visible, the rendered jpeg needs to be kind of the background of the scene.

    VideoPlayer object has a nice feature under "Render Mode" where we can select for it to render onto the far plane of a camera and the camera can be chosen as the main camera. And that would be superb, but only if VideoPlayer could load and display a single JPEG image. I haven't seen this kind of capability in any other object yet. So if I could programmatically maybe assign a texture to the far plane of the main camera, that would be great- I could then render my jpeg on a new Texture2D and then assign that texture2D object as a texture of the main camera's far plane, but I don't know how. Alternatively if another component (similarly to VideoPlayer) could render directly to main camera's far plane, then that would work too, but I don't know such component.

    Can anyone please give me some pointers?

    Thanks
     
  2. Vampsz

    Vampsz

    Joined:
    Oct 18, 2018
    Posts:
    13
    What about making a canvas at your far plane/setting it at far plane through code and showing it on the canvas?
     
    archie1983 likes this.
  3. archie1983

    archie1983

    Joined:
    Sep 29, 2021
    Posts:
    2
    Yes, that did it, thanks. Canvas is the component that has this ability along with videoplayer. Thanks.