Hi,I want to get the right HDR-image,but iOS get the image with obviously square color block upon right image.
In fact , I finally found the key reason and solve the problem by myself: iOS can't support texture-sample for RGBA32Float format . in Metal ,it's MTLPixelFormatRGBA32Float , to solve this problem ,should use MTLPixelFormatRGBA16Float in instead.
Part of my code below:
texDesc.textureType = MTLTextureType3D;
texDesc.pixelFormat = MTLPixelFormatRGBA16Float;
In Metal shader, sampling with texture3d<half>.
In addition, transform my origin float-array data to float-16bit data; ==> use float16_from_float32.
Then send data to my MTLTexture with "- (void)replaceRegion: ..." .
Ps: That's all, I hope it will help others who encounter this problem.
Topic:
App & System Services
SubTopic:
Core OS
Tags: