Seams in Skybox

Hi Everyone! :slight_smile:
I guess this topic is in every forum, but I can’t just find the answer! It doesn’t work, and I am about to give up :frowning: .

I am using GL_CLAMP_TO_EDGE but seams still are visible. :confused:

I am using Visual Basic, and the reference file vbogl.tlb, does not include the GL_CLAMP_TO_EDGE constant; therefore, I defined:

Public Const GL_CLAMP_TO_EDGE = &H812F

This is my texture-loading routine:

 (...)
'Create the Mipmapped Texture
 glBindTexture glTexture2D,rsTextures(rsTextureSlot)
glTexParameteri glTexture2D, tpnTextureMagFilter, GL_LINEAR
glTexParameteri glTexture2D, tpnTextureMinFilter, GL_LINEAR_MIPMAP_NEAREST
gluBuild2DMipmaps glTexture2D, 3, bmInfo.biWidth, bmInfo.biHeight, tiBGRExt, _
 GL_UNSIGNED_BYTE, ByVal VarPtr(baImageData(0))
   
   Call glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)
  
  Call glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)
   

Please someone help me get this to work!. Thank you so much all in advance! :slight_smile:

If you mean you got black lines at the borders of some textures, it could be normal. Check the images.

Thanks for your reply! :slight_smile:

“It could be normal”!???
What do you mean!?
Are you implying that the image itself is causing me trouble!?

I rendered in Terragen and saved as bitmap… :confused:

I found out the problem thanks to Dorbie!!! :wink:
Here goes the explanation for all VB users:

Public Const GL_CLAMP_TO_EDGE has to be defined like this: &H812F& NOT &H812F.

The two ampersand forces the conversion to Long instead of Integer thus providing the correct value constant 33071 in decimal form.

Integer values range only from (2 bytes -32,768 to 32,767), and therefore the constant was not loaded properly.

Everything works like a charm. PERFECT! :smiley:
THANK YOU ALL SO MUCH!

Please do not crosspost in future, simply pick the most appropriate forum.