Precision highp float / mediump on iOS14,iPhone14

It seems that the definition of precision highp float / mediump on iOS has changed recently.

The same behavior was not seen before on iPhone6S, iOS13. If I remember correctly.

The Chapter of Random

For example, the above site is displayed in black on iPhone 14 mini and iOS14, but it is displayed correctly when I change mediump to highp. Also, if I reduce the number of digits enough, it shows up too.

I couldn’t find a similar post in the forum, so I’ll share it.

I haven’t been able to determine if it’s the OS or the hardware that’s causing this. Does anyone have more accurate information?

1 Like

The way the precision qualifier is used in The book of Shaders can be confusing. The problem is that precision mediump float; still results in 32 bit floating point precision (highp) on almost all desktops. That makes it of course hard to test shader code with lower floating point precision.

mediump on mobile usually means you get 16 bit floating point precision which probably breaks the shader code. Requesting highp brings back single precision and thus the demo works again.

1 Like

Thank you so much! Your explanation has cleared up the situation for me.