Author Topic: <coding> Vert norms question  (Read 1714 times)

0 Members and 1 Guest are viewing this topic.

Offline Kopachris

  • 28
  • send penguins
    • Steam
    • Twitter
<coding> Vert norms question
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?
----
My Bandcamp | Discord: Kopachris#0001 | My GitHub

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: <coding> Vert norms question
I've been under the impression that the vertices get duplicated in such cases, not only the normals. Anyway, I don't recall how exactly I determined that before, so maybe your interpretation is more accurate, I don't know.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: <coding> Vert norms question
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.
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Kopachris

  • 28
  • send penguins
    • Steam
    • Twitter
Re: <coding> Vert norms question
I've been under the impression that the vertices get duplicated in such cases, not only the normals. 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.  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?)
« Last Edit: December 14, 2012, 01:49:51 pm by Kopachris »
----
My Bandcamp | Discord: Kopachris#0001 | My GitHub

 

Offline Kopachris

  • 28
  • send penguins
    • Steam
    • Twitter
Re: <coding> Vert norms question
Question resolved: http://3dengine.org/Vertex_normal



It looks like it works exactly as I thought it works.
----
My Bandcamp | Discord: Kopachris#0001 | My GitHub