Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LOD handling #2

Open
rjindael opened this issue Mar 19, 2024 · 1 comment
Open

LOD handling #2

rjindael opened this issue Mar 19, 2024 · 1 comment

Comments

@rjindael
Copy link
Member

No description provided.

@rjindael
Copy link
Member Author

rjindael commented Mar 19, 2024

RobloxMesh should have a new property std::vector<RobloxMesh> lodMeshes, bool isHighQualityLodMesh, bool isLodMesh, RobloxMesOptimizer(enum) optimizedBy`

In v3, there is special data at the "end" of the data (i.e. after all the other data, meaning after the vertices and faces). It is a series of uint32s, or more simply just a uint32 array. It can be a uint16 instead if sizeof_LOD (found in the mesh header) != sizeof(uint32). It has numLODs elements (numLODs was also detailed in the mesh header.) This series represents ranges in the face array where certain faces belong to certain meshes. So, if it is {0, 1000, 2000, 3000} (sizeof(ranges) ALWAYS % 2 == 0) then main mesh is faces 0-1000, 1st LOD mesh is 1000-2000, and 2nd LOD mesh is 2000-3000.

V4 does a semi similar approach. It has a property detailing the simplifier used on the included LOD meshes, which can be None, Unknown, RbxSimplifer, and ZeuxMeshOpt. We can use ASSIMP post-processing for "Unknown", and reverse engineer for the RbxSimplifier algorithm (I believe it is just optimizeMesh somewhere in the Rendering code?) and mesh opt is an open source library we can already use. sizeof_LOD is omitted so we can safely assume the face range array will be uint32. Besides rearranging LOD data in the mesh, there is now an additional byte (0-255) telling how many HQ LODs are in the mesh. This is just metadata.

V5 is just V4 with FACS data at the end. No modification to LODs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant