- Home /
 
Issues with Render Texture
I have a scene where i want to set up a second camera screen, kind of illustrating something else that's happening somewhere else in my game. I found a tutorial that helped me understand the concept. But that tutorial is good if you want to have in-game objects (like monitors) to display whatever camera they want to display. But I want to have the render texture be displayed on the top right corner of the screen. I created a script and managed to get the render texture like a GUI, but the problem is that it renders it transparent and i want it to be displayed solid.
This is the code I have right now. I have it attached to an empty game object.
 using UnityEngine;
 using System.Collections;
 
 [ExecuteInEditMode]
 public class GUIWindow : MonoBehaviour {
     public RenderTexture r_texture;
     public Texture2D t2d_BackgroundTexture;
     public Texture2D t2d_texture;
     public Rect windowDimensions;
     // Update is called once per frame
     void OnGUI () {
         //GUI.Window ();
         GUI.DrawTexture(windowDimensions, r_texture);
         GUI.DrawTexture(windowDimensions, t2d_texture);
     }
 }
 
               Is there a way to remove all transparency so that I can have my other camera display things correctly?
If i correctly understood, you need picture-in-picture. Try this: https://www.youtube.com/watch?v=9ll6UP-kG40#t=2518
@JustFun $$anonymous$$ore or less. What I want is to have a GUI window displaying the render texture. I managed to show something, but its all transparent.
Answer by igorgiv · Aug 05, 2014 at 08:37 PM
Have you tried setting alphaBlend argument (the third argument to GUI.DrawTexture) to false?
Your answer