Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.