- Home /
Make portion of mini map camera transparent
Here's an overview of what I'm trying to do.
I have a simple camera that orbits around a game object in the scene. I would like to render that game object as a UI element in the lower left part of the screen but with the same perspective that you see when looking through the main camera.
I initially tried parenting a duplicate object to the camera whose rotation was driven by the original. This looks bad because I have a large FOV (the object looks stretched into the camera). The perspective also does not match the original and is skewed because it's position is offset from the cameras forward. See image below.
A solution that I believe would work is to have a second camera that points at the original but is drawn as a mini map in the bottom left corner. However, when doing so, I can still see the background color of the scene in the mini map and thus the whole camera rectangle.
I'm curious if I can draw the cube in the mini map rectangle, and leave the rest of the camera rectangle transparent based on a specific color (in this case the scene background color). In this case, the only object you would see in the bottom left hand corner is just the cube.
Am I thinking about this problem correctly? Is there an easier way draw an object on screen as you see it in the world?
On the cameras inspector there is a field called 'clear flags' try setting that to 'Don't clear' or 'depth only' perhaps?
Thank you! I haven't tried this yet. I'll let you know if it's what I'm looking for.
$$anonymous$$any thanks Scribe! This was exactly what I was looking for. Per usual, there is an easier way to do what I wanted than expected. Cheers!
Answer by Steampunk_Droid · Jan 08, 2015 at 09:39 PM
This should help you a lot: (P.S. I've followed this and it works)
Thank you for the response. I've watched this and while it's super cool, I don't think it will work for my purposes. Because the cube in the bottom left (that's a part of the $$anonymous$$i map camera) will rotate around to match the orientation of the cube from the main camera, there isn't a single texture that I can use for making the surrounding area of the camera rectangle transparent. Ins$$anonymous$$d of a texture, I think I would need to make the camera rectangle transparent based on a color.
Your answer
Follow this Question
Related Questions
When more than two cameras my screen lags. 1 Answer
Disabling Camera MSAA has no effect if a later Camera has MSAA enabled 1 Answer
creating opacity on a mesh based on another overlaying mesh 0 Answers
materials visible if seen by (1) all or (2) any camera(s) 0 Answers
How to set the camera to render object exactly the same with what the other camera is rendering ? 0 Answers