- Home /
Make a round minimap?
I have unity free, and i drew a black circle in GIMP but i don't know how to use it to mask the camera view to be round for my minimap. help is appreciated!
@$$anonymous$$mmpies really sorry to bother you again, but your knowledge on $$anonymous$$imaps helped me earlier and now im making a real $$anonymous$$imap!
Not anywhere I can use Unity at the mo but I'll have a look when I get back to my laptop. Think you might struggle with Unity free though, easy with pro apparently.
what tecnquie are you using to make the $$anonymous$$i map, I would sujest that you make your camera render to texture, then add a mask to it
Thats okay someday i will buy the pro license and my games will have that ability.
Answer by InvincibleCat · Feb 12, 2015 at 07:57 PM
Create a 2d representation of your 3d object. As you know its position on the 3d world, it is easy to convert it to a 2d position in your map. (use Image)
If you have pro version, use render textures with UI Mask
You also can have a simple squared minimap using an other camera like you can find here
Have you tested this @InvincibleCat the UI will mask other UI elements but I'm not sure it'll mask 3D elements in the scene. Really hope you have and can show how it works with a $$anonymous$$imap as it'll save me a lot of work! :¬)
The mask is only going to mask CanvasRenderer objects.
Exactly what I thought @DanSuperGP, may have to work on a super stupid solution for free, well dashed my hopes of an easy solution but many thanks for the clarity.
and what about having a 2d representation of the 3d world ? Like almost every games ? I just think that @awplays49 should start learning ins$$anonymous$$d of asking everyone to do the work for him...
Thats exactly why im posting @DanSuperGP because it can't be don't with masking. Unless it can be, thanks for everything guys. I hope to see you all around.
Answer by DanSuperGP · Feb 12, 2015 at 11:38 PM
You could use make a 3d model of a plane with a circular hole cut out of it... put it in front of the camera that's capturing the minimap, and then use a depth map shader.
http://wiki.unity3d.com/index.php?title=DepthMask
This will cause everything covered by the plane to not be drawn at all.
With the right settings for the both cameras depth, Normalized ViewportRect, and clear flags, it should work.
Edit : This was a hunch... and it worked like a charm.... here's what I did ...
This totally worked for me... I was able to make a circular minimap with this technique... let me break it down how I did it.
First in Maya... I made a plane... and then a sphere... and then did a boolean difference operation to cut a circular hole in the plane. Then I exported this to FBX. (This can be done in blender too, for sure)
Second, I opened a scene I already had... and added a new camera, and positioned it where I wanted the minimap camera to go.
I set the camera Clear Flags to Depth Only, the Depth to One, and Viewport Rect to X 0.75, Y 0.75, W 0.25, H 0.25.
My main camera has Depth 0, I didn't change anything else.
I dragged the plane into the scene... parented it to the camera, and positioned it so that I could see what I wanted through the circular hole in the plane, and the grey default shader filled the rest.
I made a shader based on the DepthMask shader in the link above... but I edited it so it would draw BEFORE all the geometry.
Tags {"Queue" = "Geometry-10" }
I created a material for the shader.
I applied the material to the plane.
If you don't have the pro version you have 2 solutions.
Use a second camera with a smaller viewport.
Or create a REAL 2d $$anonymous$$imap. That is not a lot of work. Obviously more that the 1st solution
Your answer
Follow this Question
Related Questions
Problems with Minimap 1 Answer
Map Camera 1 Answer
Draw trapezoid on minimap with support for any camera angle 2 Answers
Make portion of mini map camera transparent 1 Answer
How can I make a clickable/functional RTS style minimap? 0 Answers