or:
The decal problem can be solved rather simply by using the painter’s algorithm (i.e. drawing from
back to front) combined with color buffer and depth buffer masking, assuming the decal is contained
entirely with in the underlying polygon. The steps are:
1. draw the underlying polygon with depth testing enabled but depth buffer updates disabled.
2. draw the top layer polygon (decal) also with depth testing enabled and depth buffer updates
still disabled.
3. draw the underlying polygon one more time with depth testing and depth buffer updates
enabled, but color buffer updates disabled.
4. enable color buffer updates and continue on.
http://www.dcs.ed.ac.uk/teaching/cs4/www/graphics/Web/advanced_ogl.pdf
http://ldc.usb.ve/~vtheok/cursos/ci4321/pdfs/02.pdf
http://pjp-75.uio.no/backup/Salvage/Game.Design.eBooks.Pack/Programming/
right click the link and click save object as