ok, looking at those screenshots, I guess that :
1- you render your lightmaps in a second pass (you already told it btw),
2- you render your lightmap using another geometry than the terrain geometry,
3- you render your lightmap using the primitive GL_TRIANGLES (not GL_TRIANGLE_STRIP, not GL_QUADS...),
4- you already map your texture coordinates and your texture is ready (I mean, texturing is not the problem here),
5- you encounter Z-fighting (ie flickering due to depth buffer).
For point (1) and (4) there's not much to say, and other points could be corrected IMO.
(2) and (5) : What I mean by "you render your lightmap using another geometry than the terrain geometry" is that the tesselated quad (oui la lightmap est plaquée sur un carré découpé en plein de mini-triangles, j'en mettrais ma main à couper

) where you render your lightmap uses vertex coordinates that are slightly different than the terrain vertex coordinates. The problem is the "slightly difference". When the polygons are rendered by OpenGL through the pipeline, the depths that are computed at each vertex of the lightmap will be "a little bit" different than the depths that were computed by the terrain. Yes they are different, not that much different but yes they are. This is due to floating point precision issues. This results in depth comparisons that sometimes fails sometimes not, so when depth testing is enabled sometimes the pixel will be rendered sometimes not. That's why your polygons are "brushed" (ils ont une trame plus ou moins réguilière mais ne sont pas complètement pleins). This is what we call "Z-fighting". Maybe you've ever heard of it. (btw please take no offend if you already know what Z-fighting is ! I just don't know your OpenGL knowledge).
There are a few methods for escaping the problem. Recently, Roming22 experienced a similar problems (with shadowmaps, really similar to your lightmaps to say the least) that we discussed
here (edit: changed stupid typo for the link). If you read this discussion, you'll see at the end of the thread that I enumerated some of the most populars methods that removes or attenuates Z-fighting.
(3) : It's possible that you render your mini-triangles (the ones that tesselates your lightmap) with the GL_TRIANGLES primitive. In that case, if you use it in combination with backface culling (ie glEnable(GL_CULL_FACE)) you have to be careful of the order of the vertices that are sent for each triangle. In the above picture, it looks like half traingles are sent CCW and the other half are sent CW (if you don't know what I mean by CW or CCW feel free to ask). What is really strange is the bottom picture where all triangles are visible ! It's like backface culling is not the problem, unless you sent degenerated quads (you don't, do you ?).
BTW, don't blame school. "Blame yourself or God"
[edited by - vincoof on December 12, 2002 6:13:20 PM]