It’s working in the sense that it’s returning a linear colour value, but the value is totally wrong. It seems to be some kind of strange conversion to 8-bit perhaps?
For example, the value at pixel 0 should be [1100, 976, 1088] but it’s giving me [125, 100, 170].
Is there some additional code I need to be adding to make sure I get correct (HDR) values here?
The compression settings on the texture are HDR (RGB, no sRGB).
So I realised one thing that would definitely make this fail, and that’s that FColor is only 8-bit anyway, and I need to be using FLinearColor. Also, FByteBulkData is 8-bit, so I need to be bringing in the BulkData as FUntypedBulkData (I believe). So here is the updated .cpp code:
Virtual Texture Streaming: false
Note that probably not all of these settings are required, I didn’t test each one separately, the streaming related settings are likely only necessary when doing this in a separate thread.