Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Rendering a box to an entity using a RenderLayer


 Share

Recommended Posts

I want to render a box that will be part of the entity's head bone using a RenderLayer. it should have some logic (to check the entities data, and render / not render accordingly), and use a different texture than the rest of the model. (note that the texture size is different as well.)

how should I implement that?

Link to comment
Share on other sites

Quote

Specifically the render() method of the RenderLayer

That's not specific, that's the whole thing. 🙂

You would be better looking at some vanilla examples, e.g. the CustomHeadLayer which renders if the entity is wearing a skull

It sounds similar to what you are trying to do.

Link to comment
Share on other sites

I don't know if this is the place to teach about minecraft's rendering system?

There's no docs, most people learn it by looking at the minecraft source.

Quick answers to your questions:

 

PoseStack is a stack of transformation matrices. The idea is you can push a new context on the stack, transform the pose (translate, scale, etc.), then pop to restore the previous state.

 

The buffers are what is sent to opengl. Typically you don't use them directly, instead you use helper methods and pass it a buffer, e.g. ItemRenderer.renderItem() takes a buffer as parameter.

If you do want to use them directly you can find some simple examples of what can be done in net.minecraft.client.gui.GuiComponent.

NOTE: Like the names suggest, these method are for drawing the gui, you will typically be passed a buffer to use in world rendering. You can still create your own.

 

For "attaching" look at EntityRenderEvent.AttachLayers. You can getRenderer() of the entity type you want to modify and addLayer()

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

 Share



×
×
  • Create New...

Important Information

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