GPUOpen-Archive / amd_tootle

AMD Triangle Order Optimization Tool.
MIT License
224 stars 38 forks source link

TootleSample does not properly handle 'g' lines in obj files #16

Closed AndrewJDR closed 4 years ago

AndrewJDR commented 8 years ago

If the source obj file has more than one 'g ' line (mesh group), these will be handled strangely in the output obj. You'll end up with several contiguous group lines in the output with no faces defined within them, like so: g Group1 g Group2 g Group4

This is because TootleSample completely suppresses, re-orders, and re-prints all of the 'f ' lines in a separate pass, but still prints through the mesh group lines from the original file.

Some options: Just ignore / don't print 'g' lines at all in the output, and end up with one big mesh. (More complex) Optimize each mesh group separately so that faces don't get re-ordered across 'g ' boundaries.

Anteru commented 8 years ago

Wonder if replacing the OBJ reader wholesale with https://github.com/syoyo/tinyobjloader should be done at the same time?

bpurnomo commented 8 years ago

That is even better. The TootleSample was initially written as a simple example code for how to use the tootle library.