Jump to content

[1.7.10]Is it bad to rebind a texture multiple times per frame(performance)


Recommended Posts

Posted

Hello,

did not find a better heading.

I want to render a vanilla cow with different textures (vanilla and vampire) dependent on the entity extended properties.

For that I created custom rendere extending the vanilla cow renderer and registered in the RenderRegistry for the vanilla cow entity.

The renderer rebinds the texture every onRender call, wherby it checks which texture to bind. (For testing purpose depening on health):

 

protected ResourceLocation getEntityTexture(EntityCow cow)
    {
    	if(cow.getHealth()<10.0f){
    		return vampireCowTextures;
    	}
        return cowTextures;
    }
    
    public void doRender(EntityLiving cow, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_){

    	this.bindEntityTexture(cow);
    	super.doRender(cow, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
    }

 

My question is, will that affect the performance, when I use this for multiple differnt mobs, or is it better to create a own entity with own renderer and replacing the cow entity with it, after it becomes a vampire?

Or maybe there is another solution.

 

I hope I explained myself partly understandable.

Thanks in advance.

 

maxanier

Minecraft Second Screen Mod: Use your mobile as a second screen for Minecraft and see your inventory, redstone stati, the chat and much more on it.

link

Vampirism: Become a vampire in Minecraft

link

Posted

Thanks for the quick answers.

Thats sounds good.

I wasnt sure, and I was not able to setup a reliable "try it and see" environment.

 

maxanier

Minecraft Second Screen Mod: Use your mobile as a second screen for Minecraft and see your inventory, redstone stati, the chat and much more on it.

link

Vampirism: Become a vampire in Minecraft

link

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.