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. Dismiss Notice

Unity 5 Render Texture on Canvas

Discussion in 'Editor & General Support' started by glogic1, Mar 17, 2015.

  1. glogic1

    glogic1

    Joined:
    Mar 22, 2010
    Posts:
    7
    Hi folks,
    I am trying to render a camera view onto the new Canvas UI. I basically have a secondary camera for my map screen that only can see a certain layer. I have created a render texture and set it to my map camera texture target. I have also created a new material with the shader set as standard. I dragged the render texture on to Albedo in Main maps. I have then used this material on the image script within a panel UI object.

    But it is not displaying what the camera sees.

    What is the correct way to display what my secondary map camera sees on a UI Canvas?

    Any help would be great thanks!
    G
     
  2. steakpinball

    steakpinball

    Joined:
    Dec 1, 2013
    Posts:
    9
    A `RawImage` component should be able to use the render texture.
     
  3. sbasher314

    sbasher314

    Joined:
    Nov 9, 2014
    Posts:
    4
    You don't even have to make a material (unless you need to reuse the exact same renderTexture multiple places). What I would do is create a new rawImage gameObject, and set the source to the renderTexture you've created. Also, make sure that your renderTexture's settings are properly set (otherwise it won't render the image with the correct resolution).