Jump to content

Armor 3D model ( Wavefront ) causes massive fps drop


Gugu42

Recommended Posts

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 :/

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.