Differences between render targets on PC and iOS Metal?
I have a render target on PC that I've been drawing values outside the range 0.0 - 1.0. I'm using the UCanvasRenderTarget2D and drawing lines of various colours like so:
The IntensityScale can get quite high such that I'm drawing lines with values has high as 16.0.
This all works fine on PC. Now that I'm trying to get this to work on mobile I'm finding that everything breaks if I write values greater than 1.0.
What is the difference between render targets on iOS Metal compared to PC. I've verified that both platforms are creating the render target with a pixel format of PF_FloatRBGA which seems to translate to DXGI_FORMAT_R16G16B16A16_FLOAT on PC and MTLPixelFormatRGBA16Float on iOS Metal. They should be the same, right?
It would be easier to understand if the problem could be seen. Capture an Xcode trace of iOS Metal to look at whether this is really a rendering issue into the float-16 target or a difference in the way the value is resolved into the final RGBA8 output. I suspect it is the latter from the information you've provided.
answered Jun 06 '16 at 04:28 PM
Looking into it further it seems that ProcessMaterialColorTextureLookup does the squaring because of "sRGB read approximation" but only for ES2 and ES3_1 profiles (I believe iOS Metal is considered ES3_1 feature level?) I've fixed it by changing my material to use the LinearColor sampling type (instead of just Color) which just returns the texture value.
answered Jun 28 '16 at 01:50 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here