Texture projection with stenciling

whats the difference between GL_CLAMP_TO_BORDER and GL_CLAMP_TO_EDGE ?

sounds similar though.

CLAMP_TO_EDGE repeats the edge pixels of your texture image. CLAMP_TO_BORDER repeats the border pixels of your images. The border pixels are the ones that you can add to a power-of-two image, e.g. to go from 256x256 to 258x258, whereas the edge pixels would be part of your 256x256 image.

If you don’t specify border pixels, it will use the constant border color instead.

– Tom