Posted February 16, 201411 yr I'm trying to render 16*16 individual cube models with different textures all at once, that's 256 texture sets... This is causing me horrendous amounts of lag, ie. 3FPS when i usually get 150+. I cant quite work out why its taking SO MUCH time to reset the textures each time. for(int xPos = 0; xPos < 16; xPos++){ for(int yPos = 0; yPos < 16; yPos++){ GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); Opticraft.textureLoader.loadTexture(imageList[xPos][yPos]); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); GL11.glScalef(0.5f, 0.5f, 0.5f); GL11.glTranslatef(0.1f * xPos, 0.1f * yPos, 0.0f); cModel.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); } } I've a custom texture loader that borrows some inner functions from Minecraft TextureUtil's in my TextureLoader: public void loadTexture(BufferedImage bufferedimage){ try { boolean flag = false; boolean flag1 = false; TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, flag, flag1); if (inputstream != null) { inputstream.close(); } } catch (IOException ex){ ex.printStackTrace(); } } This basically bypasses the Resource Location setting, so if anything, should be quicker than setting from resourceLocation. Is this a really stupid way of doing things? There are a few different ways i can do what i'm trying to do, but this would be my preferred.
February 16, 201411 yr Is this a really stupid way of doing things? Yes. You're not saving your textures anywhere and are constantly creating new ones. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
February 16, 201411 yr Author Well, i found out a better way of doing it, i am now using a single white texture and am coloring each pixel using glColor4d. This, quite handily takes the alpha values from my textures, so now all i have to do is literally plug the texture in and it renders . Thanks for your help Draco!
February 17, 201411 yr Also, that looks fantastic. When I did a quickpass on a 3D printer block* I just rendered the item it printed if it had any in its output slot using RenderEntityItem and having a vaguely printerish Tile Entity. It didn't look like a 3D printer, at least not as we know them, but it worked for what I was doing and didn't want to spend a lot of time making it look fancy. Not visible well in this, but it was a silly thing I did because I was feeling silly. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
February 17, 201411 yr Author That's pretty cool . I was going to do something pretty similar, but then i sas iChuns Sync mod and thought it would be freaking cool if the item were to build in front of you, which this will! The overall aim is to have it build pixel by pixel into the full item.
February 17, 201411 yr Yup, that's definitely a neat idea. Mine was just a kind of "survival, but limited creative" where I needed certain stuff just be readily available. So mine can only have the item it's printing changed (added, removed) if the player is in creative mode. Then it duplicates that stack every two and a half minutes or so into the output stack (which is a standard output slot). It still has some bugs, but it's not intended for distribution. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.