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 SMGStudio · Dec 28, 2014 at 08:43 AM · meshproceduralnormalsgeometryhard

Trying to create a hard edged procedural torus mesh

I'm using the procedural mesh script on the wiki http://wiki.unity3d.com/index.php/ProceduralPrimitives

to generate a torus in code. However I want to make it with hard edges. I can do with pre made geometry by changing the soothing angle, but I am struggling to get it working on the torus.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by tanoshimi · Dec 28, 2014 at 08:50 AM

Normals are interpolated across faces. If a vertex is shared between two or more adjacent faces, you'll get a "smoothed" surface as its normal is interpolated across either face. To achieve a "flat shaded" effect with hard edges, you have to duplicate vertices in the mesh so that each face is made from 3 vertices that share the same "face normal", and interpolation has no effect. You might end up with several vertices at the same x,y,z but having different normald (this is what setting smoothing angle to 0 does - notice how it increases the vertex count of the mesh)

Comment
Add comment · Show 3 · 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 blastone · Dec 28, 2014 at 09:41 AM 0
Share

Hi tanoshimi, thanks for the answer. I understand the logic of what you say, but I have to confess when it comes to implementing that in the torus code on the link above I am at a complete loss!

avatar image tanoshimi · Dec 28, 2014 at 10:06 AM 0
Share

[ meta: Please don't post comments as answers. And how did you get 1800 silver medals on your profile?!]

Well, I'd suggest you start by working through a simpler example - make a hard edged procedural cube, for example, to get the hang of what's required.

avatar image AlucardJay · Dec 28, 2014 at 01:32 PM 0
Share

[meta : there was a bug a while ago that gave everybody lots of medals. @meat5000 can provide more info]

Cannot find the answer that included this link : http://gamedevelopment.tutsplus.com/articles/go-beyond-retro-pixel-art-with-flat-shaded-3d-in-unity--gamedev-12259

avatar image
0

Answer by BergOnTheJob · Jul 10, 2020 at 04:41 PM

If anyone is looking, this tool can harden edges on a torus or any other shape. https://assetstore.unity.com/packages/slug/166155

Happy Modeling in Unity! =)

Comment
Add comment · 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

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Conform mesh to arbitrary surfaces? 3 Answers

Seam on Procedural Mesh 1 Answer

Creating a mesh out of a linerenderer - how do you convert revolved vertices set to triangles and uv's 1 Answer

Seperating hulls in mesh 0 Answers

Meshes flipping on procedural generation 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