Hard Light Productions Forums
Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Kopachris on December 14, 2012, 10:03:45 am
-
After a looooong hiatus, I'm back to work, but I've got something I'm not sure if I understand:
Looking through a POF file, some vertices in a submodel have only one vertex normal, while others have many. If I'm understanding this correctly, vertices with only one normal are for smooth shading, while the others are for faceted shading. For the ones with faceted shading, there will be one vertex normal per face which uses that vertex, and that vertex normal which the face uses will be parallel to the face's own normal.
So, my question: Am I understanding the above correctly?
-
I've been under the impression that the vertices get duplicated in such cases, not only the normals (http://www.hard-light.net/forums/index.php?topic=81005.0). Anyway, I don't recall how exactly I determined that before, so maybe your interpretation is more accurate, I don't know.
-
I don't exactly know the answer.. but then I've never needed that information to do any FSO modding. Are you going to try to model via typing out the DAE file manually or something? Most 3D apps will handle the vertex part of smoothing on their own.
-
I've been under the impression that the vertices get duplicated in such cases, not only the normals (http://www.hard-light.net/forums/index.php?topic=81005.0). Anyway, I don't recall how exactly I determined that before, so maybe your interpretation is more accurate, I don't know.
I don't know how the game engine handles it, but in the POF file itself, you have a vertex (and preferably only one vertex with those coordinates), but that vertex can have multiple normals. I'm guessing that each vertex normal is per smoothgroup. Faces with faceted shading essentially are their own smoothgroups (i.e. smoothgroups each containing a single face). The POF file itself doesn't make any reference to smoothgroups, so I assume that's all done with the vertex normals.
I could be missing something, though...
EDIT: Nope. After importing a POF file directly into Blender using an old version of my import script, the only non-manifold parts of the mesh are the transparent parts of the cockpit, which is necessary for transparent textures, as explained here (http://www.hard-light.net/wiki/index.php/Blender_to_POF_Conversions#Nameplates.2FCockpit_Glass:). So smoothgroups are done in the model file purely by vertex normals.
I don't exactly know the answer.. but then I've never needed that information to do any FSO modding. Are you going to try to model via typing out the DAE file manually or something? Most 3D apps will handle the vertex part of smoothing on their own.
Something like that... :p More like doing research into how all this stuff works for my own amusement. Keeping in mind that I have no idea how far I'll get or how useful it'll be, you can check the link in my signature for details. (Do you think this question would be better suited to the SCP forum or the FSO Tools forum?)
-
Question resolved: http://3dengine.org/Vertex_normal
(http://3dengine.org/i/vertex_normals.jpg)
It looks like it works exactly as I thought it works.