The major problem (at first glance) appears to be that the code reading the particle data from the uncompressed buffer is not using the Channel.Offset value to determine where the channel’s data is located within a single particle. It appears to be incorrectly assuming that the channels are stored contiguously within the order they are defined in the header.
Here is a simple PRT file that I created. It has two channels: { Position float32[3]; Density float32[1] }. There are two particles with values: {“Position” : (0,1,2), “Density” : 123.5 } and {“Position” : (3,4,5), “Density” : 456.5 }. When I send this file to your program I get:
Density
1
4
0 3
Position
3
4
123.5 3 4 456.5 0 0
So the reader is not horribly crushing the data, just mixing it up. You can refer to the PRT file spec here: http://www.thinkboxsoftware.com/krak-prt-file-format/
prt_test.zip (238 Bytes)