Texture has a 'border'

Blitz3D Forums/Blitz3D Programming/Texture has a 'border'

D4NM4N(Posted 2005) [#1]
Im writing an exporter that creates a 'supertexture' for the .X format.
Weird thing is it seems to have a border around the texture.
The border seems to change color, but i cannot seem to
find out what it is blending with or where it is comming from.

Here is the terrain split apart do you can see the 'seams'


Ive tried clamping but its not making any difference.
here is my UV calculation i use when writing the terrain peices:
	;force uvs to be 1 repeat if in super texture mode
	If UVsTo1
		;textureclip#=1/1024
		uvstep#=((1/Float(trn_size-1))
		us#=0.0
		vs#=1.0
		For TV=0 To trn_size-1
			For TU=0 To trn_size-1
				V=TU+(trn_size*TV)
				For n=0 To CountVertices(surf1)-1
					If VertexX(osurf,v)=VertexX(surf1,n) And VertexY(osurf,v)=VertexY(surf1,n) And VertexZ(osurf,v)=VertexZ(surf1,n)
						VertexTexCoords(surf1,n,us#,vs#,0,0):;VertexNormal (surf1,n0,v0nx,v0ny,v0nz)
					EndIf 
				Next
				us#=us#+uvstep#
			Next
			us#=0.0000000	
			vs#=vs#-uvstep#
		Next
	EndIf 


Anyone got any ideas??


D4NM4N(Posted 2005) [#2]
Ah, ok, fixed it

	;force uvs to be 1 repeat if in super texture mode
	If UVsTo1
		textureclip#=1.0/setup_superTexRes
		uvstep#=(1.0-(2*textureclip#))/Float(trn_size-1)
		us#=0.0+textureclip#
		vs#=1.0-textureclip#
		For TV=0 To trn_size-1
			For TU=0 To trn_size-1
				V=TU+(trn_size*TV)
				For n=0 To CountVertices(surf1)-1
					If VertexX(osurf,v)=VertexX(surf1,n) And VertexY(osurf,v)=VertexY(surf1,n) And VertexZ(osurf,v)=VertexZ(surf1,n)
						VertexTexCoords(surf1,n,us#,vs#,0,0):;VertexNormal (surf1,n0,v0nx,v0ny,v0nz)
					EndIf 
				Next
				us#=us#+uvstep#
			Next
			us#=0.0+textureclip#
			vs#=vs#-uvstep#
		Next
	EndIf