- Home /
Approach(es) to remove solid color background
Hello, all!
Currently, I have a my Camera A is supposed to render my obj file. My clear flag is set to Solid Color and my Culling mask is set to the layer name of my obj file. So far, i'm successful with the rendering. However, i want to render just the obj file and leave the background transparent since I have another camera that is supposed to render something else and the solid color of my Camera A is blocking it. Is it possible to remove the solid color background using anything from Unity (ie Shaders or OpenCV processing, idk)
Any tips to achieve this would be very much appreciated.
Answer by revolute · Jun 09, 2017 at 07:31 AM
Yes, you can.
Simply set camera A clear flags to "depth only" and set your camera A depth to a value higher than camera B so that camera A is drawn over camera B.
Good day! Thank you for your response! Sadly, setting clear flag to "Depth only" isnt an option because I have a script running on that camera and it malfunctions when the clear flag is on Depth. Does this leave me with using the Graphic options ins$$anonymous$$d?
I suppose so. Or you can use render texture. Grab whatever is on the camera and draw it on the other camera. If your "obj" is a simple model, Graphics will be much easier to manipulate. However, if it is a bunch of renderers and other stuff stacked over each other (like a gui), rendertexture may be a better choice.