View Full Version : Lightmaps

06-09-2002, 11:34 AM
Currently i'm rendering my lightmaps with GL_TEXTURE_WRAP_S & T parameters set to GL_CLAMP, and GL_TEXTURE_MIN/MAG_FILTER set to GL_LINEAR . My lightmaps have (black) seems on the edge of the polygons. (I figured out this must be due to the linear filtering because when i render the scene with GL_NEAREST filtering , the seems are gone.) Who do i get rid of these seems using linear filtering? (I heard something about using a border... How does this work?)

Also, when i run the program on a geforce 2MX (my friends), there are NO seems at all. (i tried nearest to trilinear filtering).

I own a Radeon 8500...

Any ideas?


06-09-2002, 11:45 AM
Normal GL_CLAMP samples from the border color, which is black by default.

There is an extension called GL_CLAMP_TO_EDGE. You want to use that. It doesn't sample from the border. Because the majority of the time, developers who use GL_CLAMP, actualy want the functionality of GL_CLAMP_TO_EDGE, GeForce drivers, actually implement GL_CLAMP as CLAMP_TO_EDGE, thats why you dont get the black lines on the GeForce card.

I think the GF3 however does GL_CLAMP correctly. IIRC anyway.


06-09-2002, 11:49 AM
Originally posted by Nutty:
I think the GF3 however does GL_CLAMP correctly. IIRC anyway.

No, it's also the same: GL_CLAMP = GL_CLAMP_TO_EDGE.

06-09-2002, 12:01 PM
Yep, you're right. I was wondering why I got black lines on my dynamic cubemapping demo. I wasn't setting the addressing parameters at all, so it defaults to wrap I believe. Using GL_CLAMP, gives the same result as GL_CLAMP_TO_EDGE on my GF4.


06-09-2002, 12:05 PM
You can set OGL_TexClampBehavior to 1 in the windows registry for correct behaviour on GeForces.

[This message has been edited by PH (edited 06-09-2002).]

06-09-2002, 12:25 PM
Ok, that explains it! Thanks a lot guys!!


06-11-2002, 01:35 PM
To solve texture seams I usually "stretch" my textures by half a pixel.

Bryan Turner explains this perfectly at: http://www.fractalscape.org/TextureSeams

06-11-2002, 01:52 PM
The problem with the stretch is that you might want to MIP map and so the scale of the problem changes.