melowntech / libgeometry

Melown geometry C++ library.
BSD 2-Clause "Simplified" License
8 stars 4 forks source link

Can a single model have more than 65535 vertices #9

Open veyvin opened 3 years ago

ladislavhorky commented 3 years ago

Hello @veyvin,

can you be please more descriptive? It is not clear to which "model" you refer to or why it pertains to geometry library, where/when do you encounter an error, what error,... All these things should be described when creating the issue - we'd prefer to invest our time into solving the issue or answering the question instead of prompting for this very basic information.

Thanks, Ladislav

veyvin commented 3 years ago

@ladislavhorky I used contextcapture to convert to osgb, slpk and 3dtiles. I used 3dtiles and found that too many files would get stuck. The triangle index of the tiles cut out by slpk2vts on the webpage was wrong, and the software directly crashed in browercpp.exe and unity. this is my slpk. I found that the vertex limit is 2^16 in the code .uint16_t https://drive.google.com/file/d/15BCnnSiGdCKmuqN6YcU5_XKACOvRn5JE

veyvin commented 3 years ago

@ladislavhorky Unity can use meshes with vertices greater than 65535 . https://docs.unity3d.com/ScriptReference/Mesh-indexFormat.html

ladislavhorky commented 3 years ago

Hello @veyvin,

it is very much possible that VTS has limit on 65K vertices in one tile, though I have not verified it - The limit is there precisely for the same reasons described in UNITY docs. VTS is a streaming platform, thus bandwidth and size are of great importance, even more than for UNITY.

The tools usually have a parameter like "optimalTextureSize" whic has default 256x256. If you make it smaller, the tiles will get smaller, possibly fitting into vertex limit.

Hope it helps, Ladislav

vaclavblazek commented 3 years ago

The 65K limit is per sub-mesh. Tile can have more triangles/vertices in one tile but the mesh must be split into multiple submeshes. Probably slpk2vts does not handle it properly.