gpvigano / AsImpL

Asynchronous Importer and run-time Loader for Unity
MIT License
212 stars 37 forks source link

Exploit Unity 2017.3 support for 32bit indices #15

Closed gpvigano closed 6 years ago

gpvigano commented 6 years ago

Since Unity 2017.3 32 bit mesh index buffer format is supported. Index buffer can either be 16 bit (supports up to 65535 vertices in a mesh), or 32 bit (supports up to 4 billion vertices). With this PR 32 bit indices are used only when really needed (more than 6K vertices), otherwise the old 16 bit format is used, since that takes less memory and bandwidth. To make the code to work with different versions of Unity platform dependent compilation is used.