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 CornDog · Dec 18, 2014 at 04:50 PM · terrainmeshprocedural

Why is my mesh getting messed up

I have a plane that I made in Blender and then applied a modifier too that split all the triangles so that none of them share vertices. See first image: alt text

I Exported the file and then imported it into Unity (I tried both .blend and .dae) I then attempted to deform the mesh to check that the disconnection between triangles was maintained and lo, it has been broken. See second image: alt text

Why is this happening and how to I make it stop happening?

For those who would question why I would want to do this in the first place: I'm attempting to do low ploy terrain generation. Mesh deformation is the easy part. But application of flat shading to a dynamic mesh is not. If a mesh is straight imported into Unity one can use the "set smoothing angle" function in the importer to apply flat shading. However, use of the "Mesh.RecalculateNormals" function applies an averaged shading angle to all vertices and there is no programmatic method in Unity for setting the smoothing angle. Thus, I must use a mesh with triangles having no shared vertices.

I am, of course, open to suggestions as to an easier way to accomplish this goal. But I have spent hours Googling the problem to no avail.

EDIT: Links to code and .blend file

Blend File and Deform Code

(Ran out of attachments, and the code formatting was not working. hence the external links)

untitled1.png (26.8 kB)
untitled3.png (87.3 kB)
Comment
Add comment · Show 4
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 MrSoad · Dec 18, 2014 at 05:07 PM 0
Share

How are you defor$$anonymous$$g the mesh?

Can you post your .blend file in a .zip as well, thanks.

avatar image CornDog · Dec 18, 2014 at 05:27 PM 0
Share

I have added links in the post to the code and the blend file. See the edit at the bottom. Thanks for looking into this.

avatar image MrSoad · Dec 18, 2014 at 05:50 PM 0
Share

That download link is full of mal ware, please post somewhere else thanks :)

avatar image CornDog · Dec 18, 2014 at 05:57 PM 0
Share

The new link will let you download the file from my web server. Thanks again.

1 Reply

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

Answer by MrSoad · Dec 18, 2014 at 06:39 PM

You had not unwrapped your mesh. It took me a while to figure out :D

Here is a pic of your mesh and deform script running after doing the uv unwrap in Blender :

alt text


working_deform.png (2.9 kB)
Comment
Add comment · Show 5 · 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 CornDog · Dec 18, 2014 at 06:52 PM 0
Share

Thats so weird. Why does doing a UV unwrap affect the resulting mesh?

avatar image MrSoad · Dec 18, 2014 at 06:57 PM 0
Share

No idea but I was all out of ideas until I tried it with a height map, where it acted like a quad which told me that it was not unwrapped.

Once I had unwrapped it your script worked perfectly. $$anonymous$$aybe as it had no UV data and it is a single mesh object Unity or the Shader did not know how to deal with it and so it stretched the texture render over all the vert points...???

PS : Don't forget to accept my answer :D

avatar image Owen-Reynolds · Dec 18, 2014 at 08:45 PM 0
Share

It was probably a baking issue. $$anonymous$$odifiers only exist inside blender. When you exported the first time, you may have gotten the mesh without the "split verts" modifier baked in. There was probably a button you should have pressed.

When you unwrapped and exported, it just happened to force the modifier to be applied (since the unwrap had numbers for each split vert.)

avatar image CornDog · Dec 18, 2014 at 08:49 PM 0
Share

Fantastic. Thank you for the help $$anonymous$$rSoad. And to you Owen for the explanation.

avatar image MrSoad · Dec 18, 2014 at 09:06 PM 0
Share

lol, thank you @Owen Reynolds for explaining.

Odd thing is I looked at modifiers and re saved a few times with an Edge Split modifier(both using angles and with all edges set to sharp). None of these did anything, only the unwrap at the end sorted it out?

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

28 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

Related Questions

How to generate a grid for procedurally generated platforms 1 Answer

Strange shading on procedural mesh 0 Answers

How do I go about texturing a flat-shaded generated mesh? 1 Answer

No Procedural Terrain without lags? 2 Answers

Terrain detail meshes/trees via script? 2 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