Posted February 20, 20196 yr https://github.com/BeardlessBrady/Currency-Mod/blob/master-2-1.12/src/main/java/beardlessbrady/modcurrency/block/vending/VendingRenderer.java Well working on my TESR I noticed that having even just one of the block lowers my FPS exponentially. Any tips on how I can make it less laggy or other methods of rendering items in-world that'll be less straining?
February 20, 20196 yr 1. Because of this: for(int i = 0; i < 5; i++){ for(int j = 0; j < 5; j++){ GlStateManager.translate(-0.9, 0, 0); itemRenderer.renderItem(itemStack, ItemCameraTransforms.TransformType.FIXED); for(int k = 0; k < 5; k++){ GlStateManager.translate(0, 0, +0.5); itemRenderer.renderItem(itemStack, ItemCameraTransforms.TransformType.FIXED); } GlStateManager.translate(0, 0, -2.5); } GlStateManager.translate(4.5, -2, 0); } 2. Check out FastTESR. Some tips: Spoiler Modder Support: Spoiler 1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code. 2. Always post your code. 3. Never copy and paste code. You won't learn anything from doing that. 4. Quote Programming via Eclipse's hotfixes will get you nowhere 5. Learn to use your IDE, especially the debugger. 6. Quote The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it. Support & Bug Reports: Spoiler 1. Read the EAQ before asking for help. Remember to provide the appropriate log(s). 2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.
February 20, 20196 yr Author I know thats the problem. Im asking if you know of a more efficient way to implement it. And I will look into the FastTESR thank you. Basically I want to render the inventory of the block in-world in the model. The apples are just temporary till I get the render working. Edited February 20, 20196 yr by BeardlessBrady
February 20, 20196 yr A FastTESR would probably boost your performance significantly, but there will still be some lag as rendering 125 ItemStacks per frame is very demanding on resources. Edited February 20, 20196 yr by DavidM Some tips: Spoiler Modder Support: Spoiler 1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code. 2. Always post your code. 3. Never copy and paste code. You won't learn anything from doing that. 4. Quote Programming via Eclipse's hotfixes will get you nowhere 5. Learn to use your IDE, especially the debugger. 6. Quote The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it. Support & Bug Reports: Spoiler 1. Read the EAQ before asking for help. Remember to provide the appropriate log(s). 2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.
February 20, 20196 yr Author I suppose Ill have to move it down to just 25. Unfortunately when using the FastTESR I put the same code in the render method from above in the fastTESR's 'renderTileEntityFast' and it crashes. Any idea why?
February 21, 20196 yr 43 minutes ago, BeardlessBrady said: Unfortunately when using the FastTESR I put the same code in the render method from above in the fastTESR's 'renderTileEntityFast' and it crashes. FastTESR works differently than TESR. You cannot just copy the code from a normal TESR to a FastTESR. Checkout: https://mcforge.readthedocs.io/en/latest/tileentities/tesr/#fasttesr In short: You cannot reference GlStateManager and GLXX in FastTESR. Some tips: Spoiler Modder Support: Spoiler 1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code. 2. Always post your code. 3. Never copy and paste code. You won't learn anything from doing that. 4. Quote Programming via Eclipse's hotfixes will get you nowhere 5. Learn to use your IDE, especially the debugger. 6. Quote The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it. Support & Bug Reports: Spoiler 1. Read the EAQ before asking for help. Remember to provide the appropriate log(s). 2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.
February 21, 20196 yr In addition ItemRenderer#renderItem draws the item into a different buffer than your FastTESR gives you so if you keep using it nothing will change in terms of performance. You will need to upload the bakedmodel of your items to the FastTESR's buffer.
February 21, 20196 yr Author How would I go about getting a baked model from an itemstack or get its vertex data? Edited February 21, 20196 yr by BeardlessBrady
February 21, 20196 yr A baked model is a collection of baked quads which is a collection of vertices. They effectively are vertex data. IBakedModel model = Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(stack, (nullable) world, (nullable) facing); model = ForgeHooksClient.handleCameraTransforms(model, ItemCameraTransforms.TransformType, false); About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
February 22, 20196 yr Author Thanks, I figured it out! Edited February 22, 20196 yr by BeardlessBrady
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.