Do not forget to put the 3D layer in the smode tree in the same order as they are displayed in the 3D space. Doing that smode will perfectly compute every single little pixel and give you a nice and shiny render. The same thing apply when doing a repeat over a geometry, always think of this order.