Reducing “Near Clip” was one of the first things I tried but it doesn’t help (in fact, it introduces an artefact and flickering).
I, too, though that it might be an issue with the world-to-screen conversion. Indeed, these values look like a likely cause:
Renders correctly
[
-2026791.601781152, 1372756.0914588473,
-2026791.6017792993, -1446096.2382574677,
761.787857167391, 1289.666117420334,
761.7878571673912, -415.70118738656015
]
Renders incorrectly
[
415889.4951735449, -279507.14710722025,
415889.4951736223, 295579.9674720668,
757.3918015702643, 1292.6350019286103,
757.3918015702645, -418.84295230932025
]
But after further experimentation (PlayCanvas | HTML5 Game Engine) I’m not so sure.
Correct
[
3603.666493061614, -1150.3482577680213,
3603.666493061615, 2177.2492314664587,
-1683.9788478775722, 2069.2388950468257,
-1683.9788478775727, -1258.3585941876547
]
Incorrect
[
3602.5581986625775, -1150.3482577680213,
3602.5581986625784, 2177.2492314664587,
-1682.870553478536, 2069.2388950468257,
-1682.8705534785363, -1258.3585941876547
]
Oh, and bear in mind that the render error occurs inconsistently: occurring when some vertices are out-of-bounds but not for others.
And never when the following is not used
gl_Position /= gl_Position.w;