-
Notifications
You must be signed in to change notification settings - Fork 22
Tutorial Renderer
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.
Mbd proposes a visual editor for renderer settings. Blueprint Table GUI -> renderer assistant -> IRenderer Helper.
- Select a renderer.
- After completing the renderer Settings, click "Update" to view the updated render results.
- 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
denote 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.
Clicking the F
button to open a file selector:
- select a model file.
- 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.
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.
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.
GregTech Model
renders blocks in Gregtech style.
- base texture:
base
texture will be applied to all facings. - overlay textures: can set the
front
,back
,left
,right
,up
, anddown
of the overlay texture. - 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
will render a textured particle that always faces the camera. You can use it to render special effects, such as the thaumcraft's nitor.
- F: slelect a texture/shader file via a file selector.
-
isShader
: using the shader file. -
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. -
isBackLayer
: If true, render atpass == 0
layer (opaque particles). If false, render atpass == 1
layer (translucent particles). -
Scale
: particle scale (from 0 to 100). -
Light
: lighting map (-1: follow the environment, 0-15: lighting). -
Render Range
: render range (do not render if out of eye range, -1: always render), unit: m.
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"),
- F: slelect a model file via a file selector.
-
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.