At the moment i'm using .obj file format to store 3D models. It's popular, easy to read and parse. The issue is that it stores sufrace normals for each face. This isn't an issue for me yet, but i'm keeping in mind that i have to deal with lights once i'm done with the basics of my engine. This will require vertex normals and not surface normals. I want to avoid vertex multiplication and i want nice, curved surfaces. Blender seems to be unable to store vertex normals, only sufrace normals, is this typical of 3D rendering software and file formats?
Now i'm still kind of bad at profiling and i lack experience of what's "standard", but still i want to write effective code and i can't benchmark my ideas, so please excuse me asking weird questions here.
Is it "normal" to load surface normals from the .obj file and then for each vertex do an average of all the surface normals of surfaces that use this vertex (f.e. a plane "f " in .obj says vertex of index "i" has some normal "n", so i averate this normal "n" with the one already stored for this vertex)? This seems like such an expensive calculation to do when loading a model, is this the right way to think about it? Or is there a better way (or a file format/3D editor) to deal with this issue. Having multiple normals per vertex means that i have to duplicate vertices which is out of the question, not to mention that i'd get flat shading.
I'm mostly asking this because it seems illogical that a 3D model would be stored with surface normals that are very easy to calculate and not vertex normals which aren't easy to calculate and which are required for realistic lighting. Maybe it's a "legacy" thing?
Also, while we're on the subject, how do people deal with surfaces that have to be flat planes like a brick? For light calculations these models need vertices normals to be surface normals. but if i had a model like a knife that would consist of the blade that needs to be flat and the handle that i want round i would have to have the blade with duplicate vertices and the handle with not duplicate vertices which seems like a weird thing to request from my 3D softare (if it's even possible).
How do people deal with it, the only "smart" idea i can think of is to do separate models for flat objects (that would be stored in an innefficient way with vertex copies instead of indices) and separate models for round objets that would use the averating described above. The other idea is to have a program with a geometry shader in case i want to render a flat surface that would calculate a surface normal and set each vertex's normal to the one calculated and pass that to the fragment shader (though the extent of my geometry shader knowledge is a short article, haven't used them yet, is this even possible in OpenGL?).
I feel like i'm trying to brute force the issue, maybe there's a "magic" math trick that could help me or am i just stuck with more models or shader programs to manage.
