- Home /
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;
[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.jpgYour 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.
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.
There is normally a setting in the modelling package to suggest how the face should be treated and exported (or perhaps smoothed).
(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'?
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).
Shaders interpolate between the normals at the vertices - if you want the face to be flat - they all need the same value.
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 )
I solved it. I subdivided each face 4 times in Unity, and it worked pretty well! Thanks!