Hi,
I implemented Order independent transparency using depth peeling. I use gl.beginQuery(gl.ANY_SAMPLES_PASSED, query) to detect how many layers are used. It works on windows but not on iOS. On iOS I gets almost always false positive result (rarely false negative)).
I am using two depth test. One native and One in shader with discard. Native one seems to work.
It looks like query works only with early Z test. When I do discard or modify gl_FragDepth, which disable early depth test, it doesn't work properly.
Any ideas?