Holes in Textures

Alright, so in my engine there is a texture 512x512 that is being used on a map of points 512x512. The problem lies when the heights of the points are changed, the texture seems to not stetch to fit the change in height. The texture then appears see through and you can see the rest of the map. Is there a specific property I need to set for the texture?

The rendering code:


gl.glNewList(listNumber, GL.GL_COMPILE);

	texture.enable();
	texture.bind();
	
	gl.glBegin(GL.GL_TRIANGLES);
	for(int z = 0; z < 512; z++)
	{
		for(int x = 0; x < 512; x++)
		{
			gl.glTexCoord2f((float)x/texture.getWidth(), (float)z/texture.getHeight());
			gl.glVertex3f(x, (int)points[x][z], z);
			
			gl.glTexCoord2f((float)(x+1)/texture.getWidth(), (float)z/texture.getHeight());
			gl.glVertex3f(x+1, (int)points[x+1][z], z);
			
			gl.glTexCoord2f((float)x/texture.getWidth(), (float)(z+1)/texture.getHeight());
			gl.glVertex3f(x, (int)points[x][z+1], z+1);
			
			// ---------------------------------
			
			gl.glTexCoord2f((float)x/texture.getWidth(), (float)(z+1)/texture.getHeight());
			gl.glVertex3f(x, (int)points[x][z+1], z+1);
			
			gl.glTexCoord2f((float)(x+1)/texture.getWidth(), (float)z/texture.getHeight());
			gl.glVertex3f(x+1, (int)points[x+1][z], z);
			
			gl.glTexCoord2f((float)(x+1)/texture.getWidth(), (float)(z+1)/texture.getHeight());
			gl.glVertex3f(x+1, (int)points[x+1][z+1], z+1);
			
		}
	}
	
	gl.glEnd();
	
	texture.disable();
gl.glEndList();


Previews of the problem:

You can see what it should look like in the wireframe:

And what it looks like with the texture. You can see the rest of the map because the texture is not stretching (or whatever the problem is)

Thanks in advance

Did you forget depth testing…? And disable blending, e.t.c. =S Cull face winding?

Also I don’t think you can have texture binds in your display list. Try to move the texture.bind() at least to before you call glCallList() in your game loop.

Hi

Actually, you should not use display lists because their implementation is not consistent on some recent hardware, it is a waste of time. Rather use static VBOs even though they can be a bit slower with very small datasets.

Yeah, that’s what that looks like.

You definitely can use texture binds inside a display list.

Do you have any specifics? What hardware, any particular uses that trigger it, etc? I’d really appreciate any info you might share. I’m using display lists them and haven’t had any problems (or had any problems reported).