Jump to content

Special Renderers Outdated? [SOLVED]


Jimmeh

Recommended Posts

Hey there!

 

So I know a forge developer who is quite talented and very knowledgeable, unfortunately, she's not online too often. I got to speak with her today and she mentioned that in the 1.10+ versions of Forge, block models can do nearly the the same thing that special renderers can, and more efficiently at that. Unfortunately, she wasn't online long today so I wasn't able to get much more info than that.

 

Now I just went through the whole Block class and I didn't see anything that jumped out at me. I see there's a class called BlockModelRenderer, but not a class called BlockModel. Would anyone happen to know what she's talking about?

 

Here's the current way I'm using a special renderer: https://gyazo.com/35419d1418cb792f1e48bf69810cabe4

Just a simple weapon rack (I know the weapon rotation and translation is off). Is there a more efficient way to do that with block models?

 

Any help is appreciated! :D

Link to comment
Share on other sites

It is more efficient because it just takes up ram, and it only ever "re-renders" when there was a block update(others feel free to correct me if that explanation was sub-par). While you have TESRs which get rendered to the string every single frame. And we also have the ModelBakery which has IBakedModels which made not only TESRs almost pointless, it also removed the old system of IItemRenderers. TESRs are still useful for dynamically rendering a block.

 

Overall

The ability to create the model aspect of the block instead of rendering it with a Tesselator is why it is better.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

It is more efficient because it just takes up ram, and it only ever "re-renders" when there was a block update(others feel free to correct me if that explanation was sub-par). While you have TESRs which get rendered to the string every single frame. And we also have the ModelBakery which has IBakedModels which made not only TESRs almost pointless, it also removed the old system of IItemRenderers. TESRs are still useful for dynamically rendering a block.

 

Overall

The ability to create the model aspect of the block instead of rendering it with a Tesselator is why it is better.

 

Okay, that was a pretty good explanation. haha. Can you give an example of what you mean by "dynamically rendering a block"? Does that mean something along the lines of post-chunk loading?

 

And off the top of your head, how do you do what she was saying? I couldn't find anything that seemed like "rendering" in the Block class. Or perhaps the ModelBakery that you spoke of is what she meant...? Hmmm

Link to comment
Share on other sites

What she meant was indeed most likely the ModelBakery. And by dynamically I mean it is animated with moving parts. I knew it off of the top of my head because I really dived into the information on the new model system before I did anything with it.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

What she meant was indeed most likely the ModelBakery. And by dynamically I mean it is animated with moving parts. I knew it off of the top of my head because I really dived into the information on the new model system before I did anything with it.

 

Oooooh okay. So clientside animation needs to be done via TESR's? That's actually good, because I would've been back here in the future with that exact question. xD Alrighty, so I'll try and find a decent tutorial about the ModelBakery and see if I can piece together the code transition. Thanks for the help :D

Link to comment
Share on other sites

The ModelBakery is just a class that takes jsons or obj models and compiles them into render data. *Note: If you do not know much about JSONs you should look up what they are, how they are formated then continue as they can be a little tricky at first. You do not need to look anything up about it unless you need non dynamic animation.

IE for a simple block

"parent": "blocks/cube_all",
"textures": {
     "all": "modid:block/fileName"
}

That will give you a simple cube block model. For more custom models I like to use Cubik Pro, but they can be made manually. Now you will also need a blockstate json which will typically look like.

"inventory": {
     "model": "modid:modelFileName"
}

That is for a block with no custom properties ie Directional, or metadata related. Now if you want an item for your block or an item you also need a Json file. They will typically look like this.

For a ItemBlock

"parent": "modid:blocks/blockModelFileName"

For a Item item

"parent": "item/generated",
"textures": {
     "layer0": "modid:textureFileName"
}

And that is all...

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

The ModelBakery is just a class that takes jsons or obj models and compiles them into render data. *Note: If you do not know much about JSONs you should look up what they are, how they are formated then continue as they can be a little tricky at first. You do not need to look anything up about it unless you need non dynamic animation.

IE for a simple block

"parent": "blocks/cube_all",
"textures": {
     "all": "modid:block/fileName"
}

That will give you a simple cube block model. For more custom models I like to use Cubik Pro, but they can be made manually. Now you will also need a blockstate json which will typically look like.

"inventory": {
     "model": "modid:modelFileName"
}

That is for a block with no custom properties ie Directional, or metadata related. Now if you want an item for your block or an item you also need a Json file. They will typically look like this.

For a ItemBlock

"parent": "modid:blocks/blockModelFileName"

For a Item item

"parent": "item/generated",
"textures": {
     "layer0": "modid:textureFileName"
}

And that is all...

 

Perfect. You actually helped me solve a JSON problem with my block the other day xD Yeah, I bought Cubik Studio last week and I really like it. All this Forge stuff is starting to make more sense now. I came from a few years on Spigot, so all of this is really new.

 

What do you mean by non dynamic animation? Wouldn't all animation inherently be dynamic in nature? .-. And the ModelBakery creates render data using a JSON or OBJ (thinking about it now, this is probably how something with super nice models like Pixelmon works, huh?), so what do you do with that render data? Is there some other render-outputting class that will then display it?

 

Again, sorry for all the confusion. We didn't have to worry about anything like this with Spigot, but that's the trade off for creative freedom I suppose :D

Link to comment
Share on other sites

No not all animation would be dynamic, well at least not dynamic enough. When used here dynamic is more of a changing every few frames based on a rotation variable a great example would be the animations in Immersive Engineering. BlockModelRenderer renders an IBakedModel which is the render data in this case.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

No not all animation would be dynamic, well at least not dynamic enough. When used here dynamic is more of a changing every few frames based on a rotation variable a great example would be the animations in Immersive Engineering. BlockModelRenderer renders an IBakedModel which is the render data in this case.

 

Okay, awesome. This will definitely help. I appreciate it!

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.



×
×
  • Create New...

Important Information

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