DarkStarSword / 3d-fixes

Stereoscopic 3D fixes using Helix mod & 3DMigoto
105 stars 126 forks source link

Vertex buffer expansion on export #35

Open eArmada8 opened 1 month ago

eArmada8 commented 1 month ago

Hi,

I noticed that when I import a vertex buffer, then export it again, the size of the vertex buffer is enlarged. This might be desired behavior, I do not know, so I thought I would ask.

Looking at this mesh, for example; the original mesh has 2721 vertices, and when imported into Blender, it still has 2721 vertices. The old stable script would output a mesh with 2721 vertices, but the current commit outputs 2786 vertices. The appearance of the mesh seems to be the same.

The first triangle to show a difference is triangle 325, which is at offset 0x3CA in the index buffer. 163,168,167 has been changed to 163,168,169. Vertex 167 and 169 are almost identical, except the tangent vector is now different.

This does not happen with most meshes, but I have found more than a few. So it seems that the script is determining that some vertices need to be duplicated with differing tangent vectors? Is this desired behavior?

Thanks for looking into this!

DarkStarSword commented 1 month ago

Sorry I haven't had a chance to look at this - can you confirm that you used the same version of Blender for both tests? How old was the "old stable" version of the script you used? There was a change to how normals were imported recently for Blender 4.1 compatibility that might have impacted this, though if it was a much older version of the script there could have been other changes in the interim.

eArmada8 commented 1 month ago

@DarkStarSword - sorry, I was using this commit, which was the last one before you started the updates to support segmented vertex buffers, on Blender 3.6 LTS. I noticed this behavior with the current commit, on Blender 4.2 LTS.