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 joshua-lyness · Mar 02, 2015 at 02:29 PM · texturemeshmobilebuildingcity

Mesh changing in realtime

I Making a grid based city building game, and I have a BIGGGG problem:

can you make faces of a mesh turn invisible during run time? I need a way of turning the face of a mesh invisible when an object on ground level is on the same grid space as it. For some buildings like the subway station, and road, they actually go into the ground, and so the ground needs to turn invisible or get deleted so the road is visible. Thing is though, on a 500*500 grid tile size city, making each grid space a plane that can turn visible and invisible isn't efficient for mobile devices. Plz help me or Im gonna die!

Comment
Add comment · Show 3
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 hexagonius · Mar 02, 2015 at 02:41 PM 1
Share

I can think of several ways:

  • flip the normals on the vertices (would mean you'd need doubled up vertices)

  • regenerate the mesh and remove the triangles in those spaces

  • Change UVs for that tile if you use a transparent shader and pick a transparent part of the texture

  • You could also try this

avatar image joshua-lyness · Mar 02, 2015 at 04:31 PM 0
Share

Ahhhhhh, flipping the normals sounds quite clever. Can you do that on only 1 face on a mesh?

avatar image hexagonius · Mar 02, 2015 at 05:12 PM 1
Share

Better idea: ins$$anonymous$$d of recalculating the normals(would involve adding vertices, recalculating triangles, readding normals), recalculate the triangle array and skip the area.

You won't be getting around to change at least one array since you're not allowed to access those directly. If that was possible ,you could change only one tile, but my guess is, that the physics engine does need to update a couple of things upon changes. Therefore recalculating the triangle array and recalculate the normals might be the best option you have.

1 Reply

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

Answer by curiouspers · Mar 03, 2015 at 12:20 AM

Ok, so if i understand right, you want to draw entrance to subway on top of your other mesh, so your "terrain" mesh is not visible on top of your entrance mesh.

This may be done by rendering in right order, for this you need to use custom shader, that will render your "subway entrance" mesh on top of your "terrain" mesh.

If so, then I think this is what you looking for: youtube.com/watch?v=f7zDKlsyu6s

Comment
Add comment · Show 1 · 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 joshua-lyness · May 09, 2015 at 10:32 PM 0
Share

Perfect! Sorry I took so long to respond, I never got an email notification for this, or it got buried or something. Thanks sooo much, that's perfect!

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

23 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

Related Questions

Texture type -> Advanced -> Mesh type: how it works? 1 Answer

Change texture of individual triangle on a mesh? 3 Answers

Edges/Seams/Shadows ugly with Mobile/Diffuse shader 1 Answer

Number of vertices for android 0 Answers

Mesh Renderer Fade in and fade out.[Mobile Platform] 1 Answer


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