Googling this, it seems fbx uses negative indices to indicate the end of a polygon.
@Kwyrky are they still negative after processing them, because that shouldn’t be the case. If you’re doing your own processing, bitwise negation should be fine (just make sure the type of the indices is what’s expected short vs int).
The model is loaded into a MonoGame Model object the indices consists of positive and negative values looking into it with the debugger. I also found some mentions googling, that negative values indicate the end of a polygon. And the advice of doing this bitwise negation or using the formula above.
So it is the anvil model I posted lately to the deferred renderer thread together with the blend files packed as rar. I will paste the link here also later, on mobile right now.
I don’t know, if there is something I may have missed when exporting from blender. Or if there is maybe an option to force positive values?
When looping over the indices I just check if they are negative and apply the bitwise negation. So if you mean that by processing they are all positive after that step? I use the Standard model importer. I will check if it is maybe an issue with the data type (short vs int). I try to handle it at the moment by reading the data in to a array of that data type and then converting the result over to an int array.
I rechecked again, the model has IndexElementSize.SixteenBits…
After thinking about it, maybe the bitwise negation should be done only on the short value and not on the int value holding the short value…
But simultaneously should it in principal not work with the other formula / method?
I checked everything. Logged the converted values. Everything seemed to work as it should (regarding the conversion of negative values). The result still looked messed up…
Changed to ushort and everything worked
So now wondering if dealing with negative indices like this will work in all cases? How does the conversion from short to ushort work internally?