The article : iOS and Android - Cross-Platform Challenges and Solutions said that precision conversions will require additional cycles.So I’ve tried to avoid it.But I have had a question now.
Look at the following snippets please.
As you can see, UNITY_MATRIX_MVP is a float4x4 variable(defined in UnityShaderVariables.cginc), both vertexPos and output.pos are fixed4x4.However, I can’t avoid precision conversions at line8.How to avoid?Thank you very much!
In fact, most often, you’ll want positions to be float4. The fixed4 datatype is usually used only for fragment colors. In fact, now that I think about it, I’m pretty sure the fixed datatypes are clamped. The Cg specification on the topic states that the range must be at least -2/+2, but it doesn’t really matter what the range is - What matters is that you definitely do NOT want vertex positions to be clamped to some range. They should be float4.