Texture combine functions

Hey all, long time no chat…



So one area of openGL knowledge that I am very lacking in is Texture Combine functions.  All the books and the tutorials give a brief overview but nothing detailed, anyone know of a good link???



Having said that I am working on trying to combine 2 textures, the first is a PNG w/ transparent areas the second is the the terrain detail texture.  I would like to have the detail texture not visible in areas that the first texture is transparent.  (See first 2 pics).  I am simply stumped as to what combine modes, src, etc to use to get the desired affect (if its even possible, although I think it is).  I have tried randomly changing the combine settings to get a feel as to what I want, but everything I did rendered looking terrible…

















Also, does anyone have any idea where the artifacts are coming from in this image?  It should be a hard change into blackness but instead its left with the solid color border.  It is also in pic 2 but with a bigger hole it gets much more prominent.  Changing the Min, Max, Aniso, and/or combine settings has no effect on it…







(These images have been edited to have a the transparent hole and then applied directly to the terrain; so there is no procedural texture generation during runtime…)