- Home /
Make RenderTexture turn certain color to Transparent?
Good day, all!
I'm currently working on a Unity project and I'm stuck in this part. I have two Cameras. Camera A is for rendering the background and Camera B is for rendering the object. I've been advised to use Depth Only and the rendering works well. But I need to attach a script to my Camera B and it misbehaves when the clear flag is set to Depth Only. I've settled with just setting it to Solid Color and the only workaround I've thought of is if I could only make my RenderTexture remove all the solid color so that the only thing left is the object.
Any tips would be really appreciated. Thanks in advance.
Answer by Brogan89 · Jun 16, 2017 at 05:12 AM
mine is perfectly transparent only showing the model, and i have my settings like this...
RenderTexture
hope it helps
Interesting. I'll give this a try and let you know how it goes! Thanks :)
Answer by akisrn · Jun 16, 2017 at 07:01 AM
Hi, again!
I have attached the screencaps of my settings below.
This is the settings of my Camera A. The one that's supposed to render the background.
This is the settings of my Camera B. The one that's supposed to render the object.
This is the settings of my RenderTexture is the same as yours except that I dont have the Dimension option.
I cant find the "Use Graphic Settings" in my Rendering Path. When I try to add my RenderTexture in the Target Texture, I just get the the Render of Camera A.
@akisrn O$$anonymous$$, it might be a Unity Pro thing, I'm not sure.
What are you trying to do with the render texture? Because I use $$anonymous$$e to render a 3D model to UI.
Within run time, the lowest Depth camera will render first, i.e your Camera A will always render before Camera B, because its lower depth.
The dimensions settings is the render texture its self, within the assets folder.
Let me know exactly what you are trying to achieve, because I can't see why it wouldn't work.
@Brogan89 I'm trying to remove the black background being rendered by Camera B. So when I hit play, the object seen by Camera B will be rendered with the background seen by Camera A. x
I still don't see why that would work? In run time, what are you doing with your rendertexture? Is it on a UI object, quad, or plain? $$anonymous$$aybe if you can show a screen shot i might get a better idea
Your answer
Follow this Question
Related Questions
How to make an object always in front of the OVRPlayerController camera? 1 Answer
Scaled render texture misaligning mouse movement 0 Answers
Click a cube to move player over to that position & rotate player to face fixed point 1 Answer
Can a rendertexture be placed on top of an image? (Minimap help) 0 Answers
Help, please with rotation input 0 Answers