0

I'm getting into 3D graphics and so what I'm trying to make is a simple Minecraft clone. In Minecraft, some block types have different textures on each face. However, that seems to greatly reduce my framerate when I render these multi-textured objects. I've implemented a few measures to control which objects are rendered, but the problem is still happening, as demonstrated in this short video: http://www.pyraetos.net/lag.avi

I know that Minecraft has just one texture file, and the "individual" textures are produced with texture coordinates. Could this have something to do with it? Thank you in advance.

EDIT: If you watch the video, the FPS counter is part of the window title.

Joe Johnson
  • 177
  • 1
  • 7

1 Answers1

3

I think that your guess is likely to be right. It is going to take longer to draw things if lwjgl has to unload and reload different textures all the time. You don't have to take all of the textures and put them in a single file, though. If you have many textures in different files, you can stitch them all together into a single texture in lwjgl.

Carmeister
  • 208
  • 2
  • 8
  • That would be the most desirable thing to do. How can I do that? I am using the slick library for loading. – Joe Johnson Jul 10 '14 at 03:31
  • Unfortunately as far as I know there is no way to do it with slick. I have not used it much, but as far as I know it can only take a single file and load it into a texture. Unless I am wrong, the only way to do that using slick would be to load the images you want into java's `BufferedImage`s, combine them into a single image, and then save that image as a new file so that you can load it into a texture with slick. – Carmeister Jul 10 '14 at 03:50