I'm experiencing something really strange on an iOS mobile device. I have 4 textures, and after some profiling it seems, that doing four separate grayscale texture reads is faster, than reading the same textures from a single packed texture:
#ifdef COMBINED_METALLIC_ROUGHNESS_AO_EMISSION_TEXTURE fixed4 mraeTex = tex2D(_MetallicRoughnesAOEmissionTex, IN.uv_MainTex); fixed metallic = mraeTex.r; fixed roughness = mraeTex.g; fixed ambientOcclusion = mraeTex.b; fixed3 emission = mraeTex.a * albedo; #else fixed metallic = tex2D(_MetallicTex, IN.uv_MainTex).r * _Metallic; fixed roughness = tex2D(_RoughnessTex, IN.uv_MainTex).r * _Roughness; fixed ambientOcclusion = tex2D(_AmbientOcclusionTex, IN.uv_MainTex).r; fixed3 emission = tex2D(_EmissionTex, IN.uv_MainTex).rgb; #endif
It seems, that the second option is faster for some reason. Isn't a single texture read supposed to be faster, than doing 4 separate texture reads? Am I missing something?