Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
This question was closed Nov 08, 2016 at 06:33 PM by Deefer for the following reason:

Question answered by asker.

avatar image
0
Question by Deefer · Nov 08, 2016 at 06:04 PM · meshprocedural meshproblem during runtime

Mesh Creation at Runtime - Strange black artefacts

I am seeing weird artefacts on my mesh when I generate it at runtime. I build the mesh by looping through and assigning the correct vertices and triangle data, and it seems to be great mathematically. However, I then get various black lines as if I'm viewing the mesh from below, or that the bottom of the mesh is coming through the top of it (see the side on view below)!

Scene mode with game running: alt text

Game mode with game running: alt text

If I move the camera higher and angle the camera down I don't get it:

http://imgur.com/6Ot6910

From the bottom, just for the record (it looks like loads of straight lines, which I thought was weird, not a direct inverse of the top of the mesh, is that normal????):

http://imgur.com/ig82UE1

From the side, in case it helps (as you can see some of these straight lines from the below view here above the mesh, and I wonder if this is the cause????)

http://imgur.com/9dC6dKB

You can also see black areas on the edge of the mesh.

I generate the normals by running mesh.RecalculateNormals();

Here are my material settings:

http://imgur.com/a/tPK0U

And my object settings for the tilemap

http://imgur.com/YCIaKCd

And finally the code I use to create the mesh:

         // Build mesh
         Mesh mesh = new Mesh();
         mesh.vertices = vertices;
         mesh.triangles = triangles;
         mesh.RecalculateNormals();
 
         MeshFilter mf = GetComponent<MeshFilter> ();
         MeshRenderer mr = GetComponent<MeshRenderer> ();
         MeshCollider mc = GetComponent<MeshCollider> ();
 
         mf.mesh = mesh;
         mc.sharedMesh = mesh;


Any and all advice would be amazing, thanks for your help, and apologies if I'm doing something really stupid here!!!


Edit: I fixed the problem. It was an issue where I was incorrectly assigning one triangle per row with one wrong vertex. Once I fixed it, the mesh looks perfect, no jagged edges etc...

So, if anyone else sees the same issue, check your maths. It isn't a graphics issue at all, it's the assignments of vertices to the triangles. Thanks!

cyivplg-imgur.png (192.9 kB)
gsfpqed-imgur.png (426.4 kB)
Comment
Add comment
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

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

79 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Mesh wont render although there are no errors! 1 Answer

Mesh combining makes an incomplete mesh? 0 Answers

How is a Mesh Built? 1 Answer

Find the volume of an object that is underneath a mesh 0 Answers

Assigning uv's to multiple faces 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