- Home /
RenderTexture on GUI.
I dont know if the topic is right for this kind of problem as I already know how to show render texture on GUI, but the problem is this:
This is what I have:
And this is what I'd like to have:
So the question is: Is there anyway to prevent RenderTexture from going over the borders of that GUI? What I'm trying to do here is an "FaceCam" for player. I've done this so that there's Camera in front of player model and it's being drawn to that position with GUI.DrawTexture(Rect(0,0,0,0)... etc.
Other than that problem that it goes over borders of that circle, its working fine. :) Sorry about my English, it's not my native language and it's late night already here.
Answer by zharik86 · Oct 14, 2014 at 07:15 AM
For GUI.DrawTexture() you will always have a rectangular area. But there is a method to make part of the picture invisible. Simply in that area it is necessary to use alpha channel equal 0. I.e. for your camera it is necessary to create an alpha mask: the circle on boundary and which corners alpha channel is equal 0. I.e. the circle is similar to that you want to receive. Further, RenderTexture will remember rectangular area, but on corners the alpha channel will be 0. I hope that it will help you.
Your answer
![](https://koobas.hobune.stream/wayback/20220613165036im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Text To Texture/Image 1 Answer
Circle GUI Button, Javascript? 1 Answer
unity3d android gui flickering rendertexture GL.Clear 0 Answers