Closed mihail-hrushev closed 2 months ago
This is not a bug. The explanation is quite long, so I'll try to be as short as possible:
glTF is not an authoring format, it's a last mile format, that means that the vertex data is organized for fast rendering and not for easy editing. As a consequence, a vertex that has two adjacent polygons that share the same "vertex position" but have different UV coordinates is effectively duplicated. This is correct and there's no way to solve it from the glTF side.
Since glTF has become quite a standard, people is using it beyond its initial scope, and that's why you're having issues when importing it. I'm not an expert on blender, but the blender importer may have a checkbox to automatically weld vertices on import.
Since glTF has become quite a standard, people is using it beyond its initial scope, and that's why you're having issues when importing it. I'm not an expert on blender, but the blender importer may have a checkbox to automatically weld vertices on import.
This is a briliant and clearest explanation! With this context I see a way to work around for that subject. You also right - blender has this import option. Thank you so much!
I made a model. Works fine. I need to add UVW coordinates.
To do so - I generate for each vertex about 4 UVW positions.
And works. But when I open my model in blender, and try to edit mesh - it's exploded. Each quad are separated object now.
How to generate quads and "weld" mesh vertexes together?
using VERTEX = SharpGLTF.Geometry.VertexTypes.VertexPosition; .... var mesh = new MeshBuilder<VertexPosition, VertexTexture1>("Beams"); var material = new MaterialBuilder("Black") var prim = mesh.UsePrimitive(material ); .... //For each quad texture coordinates are created individually
void BuildQuad(VERTEX vs1, VERTEX vs2, VERTEX ve1, VERTEX ve2 ,... ) { VertexTexture1 cor1 = new VertexTexture1(new Vector2(WidthAcc, LenghtAcc)); VertexTexture1 cor2 = new VertexTexture1(new Vector2(WidthAcc-WidthFactor, LenghtAcc )); VertexTexture1 cor3 = new VertexTexture1(new Vector2(WidthAcc-WidthFactor, -LengthFactor+LenghtAcc)); VertexTexture1 cor4 = new VertexTexture1(new Vector2(WidthAcc, -LengthFactor+LenghtAcc));
} // vs1, vs2, ve1, ve2 - are singletons, and reused for neighbor quads. But in the model - it's all - exploded
While with plates, where all of them share same texture coordinate - it works fine
ArchFantasyDome.zip