Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by awplays49 · Feb 12, 2015 at 02:10 PM · minimap

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!

Comment
Add comment · Show 9
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image awplays49 · Feb 12, 2015 at 02:38 PM 0
Share

@$$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!

avatar image Mmmpies · Feb 12, 2015 at 02:43 PM 0
Share

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.

avatar image El Maxo · Feb 12, 2015 at 02:50 PM 0
Share

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

avatar image awplays49 · Feb 12, 2015 at 03:03 PM 0
Share

but render to texture is pro, @El $$anonymous$$axo

avatar image awplays49 · Feb 12, 2015 at 03:20 PM 0
Share

Thats okay someday i will buy the pro license and my games will have that ability.

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

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

https://www.youtube.com/watch?v=ZuV9Xlt-l6g

Comment
Add comment · Show 34 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Mmmpies · Feb 12, 2015 at 09:18 PM 0
Share

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! :¬)

avatar image DanSuperGP · Feb 12, 2015 at 09:22 PM 0
Share

The mask is only going to mask CanvasRenderer objects.

avatar image Mmmpies · Feb 12, 2015 at 09:26 PM 0
Share

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.

avatar image InvincibleCat · Feb 12, 2015 at 09:29 PM 0
Share

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...

avatar image awplays49 · Feb 12, 2015 at 10:58 PM 0
Share

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.

Show more comments
avatar image
1

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.

Comment
Add comment · Show 36 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image awplays49 · Feb 12, 2015 at 11:39 PM 0
Share

ok ill give it a go. thanks!

avatar image dreamothee · Feb 12, 2015 at 11:50 PM 0
Share

That won't work with every resolutions...

avatar image awplays49 · Feb 12, 2015 at 11:52 PM 0
Share

why not? and what will???

avatar image InvincibleCat · Feb 12, 2015 at 11:54 PM 0
Share

my solution will... just saying n_n

avatar image dreamothee · Feb 12, 2015 at 11:58 PM 0
Share

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

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

24 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges