Minecraftforge: [1.11] 3d item rendering is in a bad state

Created on 6 May 2017  路  13Comments  路  Source: MinecraftForge/MinecraftForge

The current system does not allow the same features IItemRenderer could do in 1.7. I'm mainly talking about the possibility to set arbitary GLStates before rendering the item, this allowed to do animations and many more things like hiding/showing or setting render parameters for a single part (like unshaded, transparency).

The new system removed that all and has only partial replacements for that. The biggest problem with the new system: serious lack of documentation. Rendering a 3d item as .obj or .json works fine, put only to the part where the model is static.

Then there is the animation api, which is close to zero documented and therefore barely used. There is one example in the forge test mods, but it explains nothing. I could not find a mod that uses the animation api on items. The only things I see are dirty hacks to get ModelBase rendered.
I can do simple animations on an item with renderHandEvent, but again dirty hack, also this only works in first person. Animations in 3rd person view or on other players/npcs are not possible that way.

I hope with at least 1.12 this issue could be resolved and the same quality/features as in 1.7 can be achieved with the new system.

My own idea to solve this is to add a proper Replacement to IItemRenderer, lets call it IItemRenderManipulator. The idea is a new easy to use replacement to IItemRenderer that uses the new system, but has callbacks for pre/post rendering of the model. The pre method could be boolean to indicate the model should not be rendered at all in this frame. The methods have access to the ItemStack, the current transformType (hand, ground, inventory etc), the Entity holding it or null. (Like IItemRenderer). This is something I could do, but I won't work on a PR when there is high chance of getting rejected. So I need feedback on this option.

The other option is to improve that documentation and useability of the animation system. But that is something I can't do. I spent already 10+ hours on the animation system and I still have no idea how it works. Required would be an example that uses it on an item with json and .obj models and explains what each parameter / file does. Which files and file structure is required etc...

Then there is the 3rd option I expect some people here will not like: get back IItemRender with modelBase. People already hack it back in anyway.

tl;dr: Fix 3d ItemRendering with animations
Option 1: alternative to IItemRenderer that works with new model system
Option 2: improve documentation and useability on Animation API
Option 3: give back IItemRender with ModelBase. (I already know this will not happen, but still...)

Stale

Most helpful comment

I've been experimenting around and plan to use the animation api in a new mod, hoping to write some documentation on it too. It actually doesn't seem that complex, just there's no documentation

All 13 comments

option 2 is the most probably of these to happen. blame fry for not documenting anything T-T

Avoiding arbitrary GL states is definitely a good thing for performance and sanity between mods. Weird broken GL states are super challenging to track down and debug in mod packs.

There are a few mods using the animation system already, I think a good first step would be to find them and make a list of examples.

Currently I know of only 2 mods that use it:
The forge debug mod. (a more complex anim on a block)
botania (2 simple uses on blocks)

If you know more mods that use it, please post links to them.

Also interesting to this topic: https://github.com/MinecraftForge/MinecraftForge/issues/2734
and https://github.com/MinecraftForge/MinecraftForge/pull/3875

It's not even used in a polished /proper manner in botania, I was just experimenting. So essentially no one uses it.

not even used in a polished /proper manner

no one uses it.

Putting a negative spin on the situation doesn't help anyone.

Okay, let me rephrase. According to pWn3d1337 above the only known mods that have released code using it are a debug mod and botania. I state that I used it in botania and even then I just guessed my way through everything.

One known mod using it in a guessy way => no known mods using it in the proper, idiomatic manner. Which means that there's an issue of discoverability (don't know it exists), usability (don't know how to use), or both.

I've been experimenting around and plan to use the animation api in a new mod, hoping to write some documentation on it too. It actually doesn't seem that complex, just there's no documentation

I've started writing documentation for this: https://github.com/MinecraftForge/Documentation/pull/100, going to do some more tonight

How about items with downloaded textures from the web?

that's not within the scope of this issue..

also an issue with the animation api is that there is currently (to my knowledge) no way to animate textures other than to replace with them with a blockstate.

This issue has been automatically marked as stale because it has not had activity in a long time, and will be closed if no further activity occurs. If this issue was overlooked, forgotten, or should remain open for any other reason, please reply here to call attention to it and remove the stale status. Thank you for your contributions.

This issue has been automatically closed because it has not had activity in a long time. Please feel free to reopen it or create a new issue.

Was this page helpful?
0 / 5 - 0 ratings