02-03-2019, 08:21 AM
(This post was last modified: 02-03-2019, 08:35 AM by Brian Beuken.)
As part of my efforts to get the UpCore working, (failed) I fired up this monster again, and its still a beast. Totally outperforms every other SBC I have, but there is an issue.
At first I thought it was a shader issue and have been labouring under that assumption for some time when I dipped back into it, but no, I've been a bit dim. The shaders work fine, after all the level OBJ file is rendering perfectly.
The problem is the MD2 loader loads a binary image, and there is a subtle difference in how an ARM CPU and an INTEL CPU deals with data, ARM's can use big endian format for data, Intels use little Endian... its not something you will notice when code is running on its own, ARM's and Intels both save and load internal data as little endian, so an int is an int is an int however it is stored and loaded it will be exactly the same.
But data saved in one format may have to be converted to the other when its loaded.. MD2 data is always stored as little endian, but it does seem that the conversion of some of that data is loading in as big endian.
Now actually my binary loader does that, making it perfect for ARM, but screws up for Intel... I need to add either a conversion or a different loader for Intel and I need to be clear where the actual data is being scrambled,thats a low priority job though, I have to fix some of the chapter 7 files first.
At first I thought it was a shader issue and have been labouring under that assumption for some time when I dipped back into it, but no, I've been a bit dim. The shaders work fine, after all the level OBJ file is rendering perfectly.
The problem is the MD2 loader loads a binary image, and there is a subtle difference in how an ARM CPU and an INTEL CPU deals with data, ARM's can use big endian format for data, Intels use little Endian... its not something you will notice when code is running on its own, ARM's and Intels both save and load internal data as little endian, so an int is an int is an int however it is stored and loaded it will be exactly the same.
But data saved in one format may have to be converted to the other when its loaded.. MD2 data is always stored as little endian, but it does seem that the conversion of some of that data is loading in as big endian.
Now actually my binary loader does that, making it perfect for ARM, but screws up for Intel... I need to add either a conversion or a different loader for Intel and I need to be clear where the actual data is being scrambled,thats a low priority job though, I have to fix some of the chapter 7 files first.
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's