Posted January 22, 201411 yr Hello ! I have a little problem. I have a model that should be rendered as a 3d armor, it has around 1700 polys, but if I render it on a TileEntitySpecialRenderer, it doesn't cause any FPS drop ( or maybe 2-3FPS ) But whenever it is rendered as a 3D armor, I drop from around 100FPS to 5-10. I really don't see what could cause this. Here are the codes : The Model class : package com.gugu42.rcmod.render; import org.lwjgl.opengl.GL11; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; public class ClankBackpackRender extends ModelBiped { RcModelManager modelManager; public ClankBackpackRender() { super(); modelManager = new RcModelManager(); } public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { GL11.glPushMatrix(); GL11.glTranslated(0.0d, 0.6f, 0.0f); GL11.glRotated(180, 0.0D, 0.0D, 1.0D); GL11.glScalef(0.04f, 0.04f, 0.04f); modelManager.modelClankBackpack.renderAll(); GL11.glPopMatrix(); } } The Item class : package com.gugu42.rcmod.items; import com.gugu42.rcmod.RcMod; import com.gugu42.rcmod.render.ClankBackpackRender; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; public class ItemClankBackpack extends ItemArmor { public ItemClankBackpack(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) { super(par1, par2EnumArmorMaterial, par3, par4); this.setCreativeTab(RcMod.rcTab); } @Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { return "rcmod:models/ClankBackpack.png"; } @Override @SideOnly(Side.CLIENT) public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { return new ClankBackpackRender(); } } I don't think it comes from the render since it updates as often as a TileEntitySpecialRenderer
January 22, 201411 yr return new ClankBackpackRender(); Well, you are creating a new model object each frame. That isn't really good.
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.