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
1
Question by Yharooer · Apr 20, 2013 at 12:56 AM · cubeshading

Splitting Up Verticies

Hi, (sorry if this is an unnecessary post) [I posted about a weird shading thing][1] that happened when I was using Tidy Tile Mapper and Directional Light (also with all types of light.) [Jessy][2] said that;

Your cubes are only 8 vertices. You can't do proper lighting with that, because the faces share normals. You're going to need to split up the faces so that each one has its own set of four normals/vertices.

[http://docs.unity3d.com/Documentation/ScriptReference/ModelImporter-normalSmoothingAngle.html][3] ![weirdshading.jpg][4] So my question is, how would I split up the faces to do this? In blender - I tried subdividing but I still had the same problem. And isn't this also a waste of resources? Instead of 6 faces being rendered 24 faces have to be rendered. Can someone explain why this is because I'm quite confused. Thanks, Yharooer [1]: http://answers.unity3d.com/questions/439830/weird-shading-thing-directional-light.html [2]: http://answers.unity3d.com/users/64/jessy.html [3]: http://docs.unity3d.com/Documentation/ScriptReference/ModelImporter-normalSmoothingAngle.html [4]: http://img19.imageshack.us/img19/7681/weirdshading.jpg
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

1 Reply

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

Answer by whydoidoit · Apr 20, 2013 at 01:03 AM

Jessy meant that each vertex on each face needs to be separate to make the sides of the cube appear flat.

This is because the normal of the vertex needs to be different for each face. You will still only render 12 triangles but there will be 24 vertices rather than 8.

Each vertex can only have 1 normal - so if you make a box out of 8 vertices then the normals can't be pointing differently for each face because there would only be 8 normals and you need each corner of each face to be pointing in the same direction to get flat shading.

alt text

There is normally a setting in the modelling package to suggest how the face should be treated and exported (or perhaps smoothed).


ybtff.jpg (14.9 kB)
Comment
Add comment · Show 7 · 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 Yharooer · Apr 20, 2013 at 01:07 AM 0
Share

(I'm a bit busy at the moment so I might not reply instantly.) I'm using blender - and I'm just importing the .blend file in Unity. Do I have to export as something else, or is there some settings in the inspector I can change to fix this?

I'm still a bit confused. What's a 'normal'?

avatar image whydoidoit · Apr 20, 2013 at 01:12 AM 0
Share

Export it as an FBX and see if there are some options for normals and smoothing.

http://en.wikipedia.org/wiki/Normal_(geometry)

The normal it a perpendicular vector for the face (it defines which way the face is pointing - so it can be lit properly).

avatar image whydoidoit · Apr 20, 2013 at 01:13 AM 0
Share

Shaders interpolate between the normals at the vertices - if you want the face to be flat - they all need the same value.

avatar image Yharooer · Apr 20, 2013 at 01:40 AM 0
Share

Ok, thanks.

"if you want the face to be flat - they all need the same value."

Sorry, what do you mean here? (I guess I'm even more hopeless that I thought at this! :D )

avatar image Yharooer · Apr 20, 2013 at 04:00 AM 0
Share

I solved it. I subdivided each face 4 times in Unity, and it worked pretty well! Thanks!

Show more comments

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

12 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

Related Questions

Stripey shading on GameObjects 1 Answer

Possible to create primitive cube offset from own origin 0 Answers

Cube meshes turn into spheres on Android export 0 Answers

GUI element blocks OnMouseOver over not GUI elements 0 Answers

Get vertices inside a box collider 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