More UV issues.. help

Blitz3D Forums/Blitz3D Programming/More UV issues.. help

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I am tinkering with single surface tiled terrain. I am able to get things to look great if i use each tile image as its own brush.. problem is that the suface count goes up with each tile type used.. so now ive put all the tile images on one large image.. and im using one brush. then assigning UVs to each quad so that the proper tile will be presented on the mesh.. but

I got this working but, slivers are appearing between tiles. heres the code im using to create the quads

please ignore some of the vars as thay are unimportant to this problem.. H1-H4 is vertex height (not causing this problem)..

it appears to be a pixel of image next to the tile being put down, like the uvs are spread to wide, but i know that cant be. any advice is greatly appreciated.
            h1#=H_map(x,z)						;top right height
    		h2#=H_map(x-1,z)						;top left height
            h3#=H_map(x-1,z+1)						;bot left height
            h4#=H_map(x,z+1)	
cnt=CountVertices( surfaceid )				; Get count of vertices
M_VDATA(1,X,Z)=AddVertex(SurfaceID,X-1.0,h2,Z)
M_VDATA(2,X,Z)=AddVertex(SurfaceID,X,h1,Z)
M_VDATA(3,X,Z)=AddVertex(SurfaceID,X,h4,1.0+Z)
M_VDATA(4,X,Z)=AddVertex(SurfaceID,X-1.0,h3,1.0+Z)AddTriangle(SurfaceID,M_VDATA(1,X,Z),M_VDATA(3,X,Z),M_VDATA(2,X,Z))
AddTriangle(Surfaceid,M_VDATA(1,X,Z),M_VDATA(4,X,Z),M_VDATA(3,X,Z))
paintgrid surfaceid,x,z,map(1,x,z)-16
Next
Next
UpdateNormals meshid
End Function


ok now here is the problem area.. this is called for each quad to paint it
the image is a 1024x1024 with 16 tiles across and 16 tiles down, each tile is 64x64 pixels..

Function PaintGrid(SURFACEID,X,Z,TileIndex)

Column=TileIndex Mod 16
Row=1+(TileIndex-Column)/16
spd#=0.0625

VertexTexCoords(SurfaceID,M_VDATA(1,X,Z),(spd#*column)+spd,(row*spd))
VertexTexCoords(SurfaceID,M_VDATA(2,X,Z),(spd#*column),(row*spd))
VertexTexCoords(SurfaceID,M_VDATA(3,X,Z),(spd#*column),(row*spd)+spd)
VertexTexCoords(SurfaceID,M_VDATA(4,X,Z),(spd#*column)+SPD,(row*spd)+SPD)

End Function


and here is an image of the artifact im fighting.