No, it's because the Z ordering is fucked in OpenGL if the textures have an alpha layer. The solution is to not use an alpha texture.
Probably they did a quick z-sort of objects to work out the draw order, and I'd guess the corner of the car slightly clips into the plane of the fence. There's not actually a correct order to draw those objects, if they're drawing them in sequence to a 2d framebuffer (which they appear to be). The correct solution is to either render to a 3d framebuffer, which means you don't have to sort as much but costs more to paint each pixel, or to sort individual polygons and still have a 2d frambuffer, but that's a much much bigger sorting operation. Or have better collision detection, so it is possible to draw in object sequence.
tldr; No way to do it better without slowing the frame rate.
+1 / Like / Tweet this post