question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

exporter unecessarily splits geometry in blocks of 65535 vertices

See original GitHub issue

Describe the bug Tried to export a huge scene, the exporter is splitting unnecessarily the vertex buffers in blocks of a max of 65535 vertices

12:00:01 | DEBUG: Adding primitive with splitting. Indices: 123480 Vertices: 65535 12:00:01 | DEBUG: Adding primitive with splitting. Indices: 210033 Vertices: 65534 12:00:02 | DEBUG: Adding primitive with splitting. Indices: 292386 Vertices: 65533 12:00:02 | DEBUG: Adding primitive with splitting. Indices: 160830 Vertices: 39829

this was caused by this code

        # NOTE: Values used by some graphics APIs as "primitive restart" values are disallowed.
        # Specifically, the value 65535 (in UINT16) cannot be used as a vertex index.
        # https://github.com/KhronosGroup/glTF/issues/1142
        # https://github.com/KhronosGroup/glTF/pull/1476/files

        range_indices = 65535

The index that marks a primitive restart is 65535, but that is only true when you are using triangle strips and 16bits index buffers. For other instances, like in my case where we are exporting triangle lists and 32 bit index buffers this doesn’t apply. Actually I made that value bigger and the scene exported and loaded fine.

12:05:48 | INFO: Starting glTF 2.0 export 12:05:48 | INFO: Extracting primitive: Mesh_0 12:06:04 | DEBUG: material_idx 0 12:06:04 | DEBUG: Adding primitive without splitting. Indices: 786801 Vertices: 236431 12:06:04 | INFO: Primitives created: 1 12:06:06 | INFO: Finished glTF 2.0 export in 17.52252435684204 s

To Reproduce Just generate a huge sphere and export it, notice the many primitive nodes

Expected behavior I’d expect just a big vertex buffer

Version 2.80

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
marquizzocommented, Feb 19, 2020

Can confirm, the new exporter that ships with Blender 2.82 solves this problem. Now that 2.82 is the latest stable version, it can be found in the standard downloads page.

2reactions
juliendurourecommented, Nov 28, 2019

@tomm1996 Sorry, I did a mistake on branch it was solved. 2.81 still split at 65534, but it should be ok in blender 2.82 alpha (you can test downloading it here : builder.blender.org )

Read more comments on GitHub >

github_iconTop Results From Across the Web

65535 vertices limit - Unity Forum
I'm trying to bring some DAZ Studio characters into Unity, and I ran into an issue. Apparently, there is a 65535 vertices limit...
Read more >
How can I make mesh have more than 65535 vertices count?
I use Unity to create some mesh with 32 bits indices, I export them and import them into BBL, I don't know how...
Read more >
Export Meshes - Gaea Documentation - QuadSpinner
Export terrains as meshes. Gaea can convert the heightmap of the terrain into a mesh using one of 2 methods: a uniform displaced...
Read more >
Blender NIF Plugin Documentation - Read the Docs
Export options include * All (nif) - Geometry and animation to a single ... Blender treats the vertex as if the faces had...
Read more >
WebGPU Shading Language - W3C
Since a block comment requires matching start and end text sequences, and allows ... When applied to the position built-in output value of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found