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 /
avatar image
0
Question by multinfs · Oct 17, 2015 at 05:31 PM · meshcubeverticesnormals

How to set mesh normals per face?

Is there any way of setting the normals for a mesh to be per face? I am using only cubes which need only one normal per face and since I'm having issues with the 65k mesh vertex limit I want to have as few vertices as possible and reuse existing vertices whenever possible.

Note: breaking my mesh down to thousands of individual cube meshes is out of question since that is waay too resource intensive. Also the project this is used for is a minecraft-ish block world.

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
1
Best Answer

Answer by Owen-Reynolds · Oct 17, 2015 at 11:37 PM

It seems like you know how to set face normals, and your question is really "Is there a way to set face normals that uses less space than splitting verts."

I think the answer is No. Graphics cards use vertex normals. We wouldn't split vets at edges to get flat faces unless it was the best way.

Now, there was an old setting for "flat faces" that tells the graphics card to use the normal of the first vert (based on the Tri array) for the entire face. It makes every single face in the entire model be flat-shaded, without needing any extra verts. But the model has to have been made with that in mind, and I'm not sure it's even in newer cards, and don't think Unity supports it.

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 multinfs · Oct 20, 2015 at 01:02 PM 0
Share

What a shame... The only solution I've found is to break down one single mesh into multiple smaller ones that can handle all the verts needed. I'm not really getting why such a option wouldn't exist anymore since less data for more geometry is a great optimization. I guess the norm of moving towards epic lighting effects and high vert count meshes renders this feature useless in most cases. But thanks anyway :)

avatar image Bunny83 multinfs · Oct 20, 2015 at 03:18 PM 0
Share

You might want to have a look at my answer over here. It's possible to calculate the face normal inside the fragment shader using the partial derivative functions. However read the post carefully ^^. The usual way is to use seperate vertices per quad face (in the case of a cube). So you need 24 vertices ins$$anonymous$$d of 8 which is 3 times as much. However the performance would most likely be better with 3 meshes and vertex normals than 1 mesh with calculated normals.

avatar image multinfs Bunny83 · Oct 21, 2015 at 12:39 PM 0
Share

Yeah, since performance is essential that is probably not the way to go.

avatar image
-1

Answer by mezzostatic · Jan 30, 2017 at 09:02 PM

you have to duplicate the vertices and give all 3 same normal to have face normals with acute shade change between faces.

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

32 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

Related Questions

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

Why does the default Unity sphere have duplicate vertices? 1 Answer

Unity is welding vertices when I enter Play mode 0 Answers

How to calculate normal direction for shared vertex position 1 Answer

Direction of a mesh 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