Skip to content

Tutorial Renderer

youyihj edited this page Feb 4, 2023 · 1 revision

In this page, we will show you how to create a custom renderer (model). Mbd comes with 7 built-in renderers: Java Model, B3D Model, OBJ Model, BlockState Model, GregTech Model, Textured Particle, and GeckoLib Model. MBD also provides APIs that allows other mods to register new renderers, see TODO. In addition, MBD provides support emissive texture, multi-layer model for all renderers, see Emissive Texture and Custom Layer for details.

image

Mbd proposes a visual editor for renderer settings. Blueprint Table GUI -> renderer assistant -> IRenderer Helper.

  1. Select a renderer.
  2. After completing the renderer Settings, click "Update" to view the updated render results.
  3. Resources refresh will cause the game to stall for a while. Must refresh to display models which have never been loaded before (obj, b3d, and geo). Also need to refresh if the texture is not loaded.

Mbd also provided a feature as the ResourceLoader mod, allows users to add local file resources. (under the ".minecrafft/config/multiblocked" by default)


Java Model

Java Modeldenote to the JSON model for the Java version of Minecraft. If you don't know how to make a JSON model, check out Minecraft Wiki and Blockbench.

It should be noted that North is the front of the model

Please save your model in the models folder(".minecrafft/config/multiblocked/assets/multiblocked/models"). Of course, without restarting the game, mbd allows to dynamically add and select any models in game. Select the model via the file selector, and when you have selected the model, don't forget to update it.

image

Clicking the F button to open a file selector:

  1. select a model file.
  2. open the corresponding folder.

Note if your model's texture is missing, probably because it was not loaded before, you can try to load textures by clicking the refresh button.

image


B3D Model and OBJ Model

B3D models and OBJ models need to be saved in the b3d and obj folders. Make sure your model names end with '.b3d' and '.obj'. Besides, the '.mtl' file of OBJ should be in the same directory as the '.obj' file.

image


BlockState Model

BlockState Model render the model based on the model of an existing block. In fact, not only the static model, but if the specific block has TESR, it will also be rendered.

Mbd allows you to drag with JEI to select a block (not in cheating mode), or select a block by typing the registery name and specify its meta value.

image


GregTech Model

GregTech Model renders blocks in Gregtech style.

image

  1. base texture: base texture will be applied to all facings.
  2. overlay textures: can set the front, back, left, right, up, and down of the overlay texture.
  3. When the multi formed, if its true and the controller also uses the GregTech Model, it will change the base texture to the controller’s base texture.

Textured Particle

Textured Particle will render a textured particle that always faces the camera. You can use it to render special effects, such as the thaumcraft's nitor.

image

  1. F: slelect a texture/shader file via a file selector.
  2. isShader: using the shader file.
  3. isAddBlend: set opengl blend mode addition. It has many uses, and you can try checking it to see what effect it has. For example, if your shader's background color is black instead of transparent.
  4. isBackLayer: If true, render at pass == 0 layer (opaque particles). If false, render at pass == 1 layer (translucent particles).
  5. Scale: particle scale (from 0 to 100).
  6. Light: lighting map (-1: follow the environment, 0-15: lighting).
  7. Render Range: render range (do not render if out of eye range, -1: always render), unit: m.

GeckoLib Model

GeckoLib Model is available when the GeokoLib mod is installed, can be used to render bedrock animation models, etc. See GeokoLib Wiki and Blockbench for how to create an animated model.

Please save your xxx.geo.json file in the geo folder(".minecrafft/config/multiblocked/assets/multiblocked/geo"),

xxx.animation.json file in the animations folder(".minecrafft/config/multiblocked/assets/multiblocked/animations"),

xxx.png file in the textuers folder(".minecrafft/config/multiblocked/assets/multiblocked/textuers"),

image

  1. F: slelect a model file via a file selector.
  2. isGlobal: whether global rendering is required. Do it if your model is large enough.

Mbd allows you to control the animation currently rendered, see Animation Models (Geckolib) for more information.