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!

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

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.