Parik27 / DragonFF

Blender Add-on to edit RenderWare and GTA Formats
GNU General Public License v3.0
346 stars 124 forks source link

possible solution to the vertex limit when exporting model #264

Closed hellwood52 closed 1 month ago

hellwood52 commented 6 months ago

Dear Parik27, what do you think about this? If this is true, then you can improve your plugin, I think it's worth it.

In the description of the DFF format in the RpGeometry section, a triangle can store indexes in the uint16 type, which really limits the number of vertices to 65k. But in fact, SA does not use these values for rendering, but takes the vertex indexes from the Bin Mesh PLG extension, where the number of indexes has already been expanded to 2147483647. The 65k limit is based on the fact that the exporter developers are looking at the outdated part of the format, which is in fact no longer used, but which cannot be cut. But no one prevents you from scoring it with zeros, and using the full potential of the Bin Mesh PLG extension yourself.

Parik27 commented 6 months ago

Hey,

That's a really interesting observation. I could implement that into the plugin. It could truncate the geometry section and save the rest into Bin Mesh PLG (or other native data formats). I don't know what effects it will have on the other games though (SA doesn't use the geometry vertices, but other games might), so I will keep the warning about too many vertices.

hellwood52 commented 6 months ago

If you implemented this idea at least as an option for GTA SA, it would greatly help the entire modding community and expand their capabilities for creating large maps.

dreamsyntax commented 6 months ago

Unless I'm misunderstanding, it would be interesting to test to see if its a partial workaround for https://github.com/Parik27/DragonFF/issues/231 in other games.

Parik27 commented 6 months ago

Unless I'm misunderstanding, it would be interesting to test to see if its a partial workaround for #231 in other games.

Well it is unrelated to this, but I want to respond to that issue by saying that exporting as triangle strip is not trivial. It requires complex algorithms to compute triangle strips from the list of triangles. Existing libraries for doing this exist but not in Python (and it would likely be inefficient if implemented in Python anyway) and hence cannot be used in Python without complicating things.