Issue reading pixel values of HDR UTexture2D
I've been working with using images as heightmaps, by reading individual pixel values of the UTexture2D object and creating a procedural mesh based on that. However, I've hit a limitation, as a regular image with 8-bits per-channel cannot hold precise enough values to create a proper landscape. So I'm trying to work with HDR images, and I've created a few HDR images and set their compression mode to HDR (RGB, no sRGB).
However, I can't figure out how to modify my code to properly read the data when it's compressed with this method.
This is the function I was using to read the data before:
I thought that I might be able to use an FLinearColor pointer instead of FColor, and then change the stride so that the correct memory would be copied, but I still seem to get incorrect values for pixels. My ultimate goal is to populate a TArray with FLinearColors with the values from the texture, to use as values for vertex locations.
Follow this question
Once you sign in you will be able to subscribe for any updates here