first of all we would like to thank you for the quick babylonjs support we are getting, it’s really amazing! Also, congratulations on the 4.2 release
In our current project we are using transparent materials a lot and babylonjs does a really great job at rendering them with the depth prepass option. It works quite well on WebGL 2.0. On WebGL 1.0 iOS 14 however, rendering artifacts which look at lot like Z-Fighting appear when used in combination with a PBRMaterial and IBL. This is not specifically a WebGL 1.0 issue because by forcing WebGL 1.0 we are not able to reproduce this issue on other devices. These rendering artifacts do not appear with a StandardMaterial or without IBL. Enabling WebGL 2.0 Preview on iOS 14.0.1 also fixes the issue however this is not an option for production.
Test device with the issue: iPad Gen 7 iOS 14.0.1
Other WebGL 1.0 devices without the issue: iPad Air 2 iOS 13.3, iPad Pro Gen 3 iOS 13.3.1
Their switch to angle will definitely address this but in the mean time you can not really use the pre pass … or would need to hack some scale down version of the mesh for it…
After some more digging, it would seem the problem could come from the fact that the precision used in the vertex shader is automatically lowered when some threshold is reached, like the number of instructions or uniforms used.
When rendering the mesh in the second phase (regular rendering), the threshold is reached so the precision is lowered, whereas in the first phase (depth pre-pass) the threshold is not reached and the mesh is rendered with full precision. That means the z-depth values don’t match anymore between the first and second phases, leading to z-fighting.
Unfortunately we can’t do much on our side, this behaviour is hard-coded in the OS/drivers (IF it is the right explanation).