PDA

View Full Version : Seams in Skybox



Rodrix
02-10-2006, 10:59 PM
Hi Everyone! :)
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 :( .

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! :)

jide
02-11-2006, 01:30 PM
If you mean you got black lines at the borders of some textures, it could be normal. Check the images.

Rodrix
02-11-2006, 04:25 PM
Thanks for your reply! :)

"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:

Rodrix
02-11-2006, 06:38 PM
I found out the problem thanks to Dorbie!!! ;)
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! :D
THANK YOU ALL SO MUCH!

dorbie
02-12-2006, 01:36 PM
Please do not crosspost in future, simply pick the most appropriate forum.