The forum's immigrant
I did a nice lighting system in 3D but my model's normals are flat instead of smooth. I'm drawing them with gm functions but don't know how to define the normals correctly. Can anyone explain how to achieve this?
Misu is talking about smoothing of the normals.What? You have normals or you don't have normals, that's it. I'm not sure i understand what you are asking.
What is your goal here? Are you talking about smooth (aka fragment based) lighting versus flat (aka vertex based) lighting?
This explanation helpped. Thanks a ton.1) Calculate the normal of the triangle facet using the 3 points that form the triangle with cross product
2) Use that facet normal value for each point. Each will have this normal. that will result is a cheap ass lighting you are complaining about. do this for every facet of your model
3) loop through each point of the model, figure out which points share the same coordinate. add all their normals and average the result and change the normal of each point to that average