Skip to content

Commit

Permalink
Update concepts doc
Browse files Browse the repository at this point in the history
  • Loading branch information
SirLich committed Nov 28, 2020
1 parent 5a76a11 commit d8e38ab
Showing 1 changed file with 42 additions and 21 deletions.
63 changes: 42 additions & 21 deletions concepts/render-controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,36 @@ parent: Concepts
Beginner
{: .label .label-green }

Render controllers are an often-missunderstood part of the Resource Pack ecosystem. You should think of render-controllers as logic packs that take short-name definitions from the Resource Entity File (from now on, the entity file), and determine how they will be combined/layered/rendered in-game.
Render controllers are an often-misunderstood part of the `Resource Pack`. But you don't need to be afraid! You should think of render-controllers as logic packs that take `short-name` definitions from the RP Entity File, and determine how they will be combined/layered/rendered in-game.

# Defining short-names

Render controllers work based on the short-name definitions of the entity file. For example, variables such as `geometry`, `materials`, and `textures` can be defined in the entity, and then accessed in the render controller. For example, like this:
Render controllers work based on the short-name definitions of the RP entity file. Short-names are local identifiers, which we define in the RP entity file, and can then use in the render controller (and other places!). Variables such as `geometry`, `materials`, and `textures` can be defined in the entity,

Lets look at a simplified version of the spider RP entity file:

{% include filepath.html path="RP/entity/spider.json" %}
```json
"materials": {
"default": "spider",
"invisible": "spider_invisible"
},
"textures": {
"default": "textures/entity/spider/cave_spider"
},
"geometry": {
"default": "geometry.spider.v1.8"
{
"format_version": "1.8.0",
"minecraft:client_entity": {
"description": {
"identifier": "minecraft:cave_spider",
"materials": {
"default": "spider",
"invisible": "spider_invisible"
},
"textures": {
"default": "textures/entity/spider/cave_spider"
},
"geometry": {
"default": "geometry.spider.v1.8"
},
"render_controllers": [
"controller.render.spider"
]
}
}
}
```

Expand All @@ -45,22 +59,29 @@ In this case, four short-name definitions have been created:

You can define multiple short-names in each array, such as in the `materials` example above.

You should think of short-name definitions as `importing` the assets you want. At this state, you are bringing in textures, geometry, etc. In the render-controller stage, you won't import anything. You will simply use the assets you already imported to create the rendered entity.
You should think of short-name definitions as `importing` the assets you want. At this state, you are defining the textures, geometry, and materials that you want to use in your entity. In the render-controller stage, you won't import anything. You will simply use the assets you already imported to create the rendered entity.

# Simple render-controller

A simple render controller looks like this:

{% include filepath.html path="RP/render_controllers/cow.render.json" %}
```json
{
"format_version": "1.8.0",
"render_controllers": {
"controller.render.cow": {
"geometry": "Geometry.default",
"materials": [ { "*": "Material.default" } ],
"textures": [ "Texture.default" ]
{
"format_version": "1.8.0",
"render_controllers": {
"controller.render.cow": {
"geometry": "Geometry.default",
"materials": [
{
"*": "Material.default"
}
],
"textures": [
"Texture.default"
]
}
}
}
}
```

Expand All @@ -72,7 +93,7 @@ Since render controllers work based on short-names, it is possible to re-use the

For example, the render controller above is used for the `minecraft:cow` entity. If you want to use this render controller in your own pack, simple define like: `"render_controllers": [ "controller.render.cow" ]` in your entity file.

`warning:` Remember! Render controllers work based on short-named. If you want to use the cow render controller, you need to provide the short-names it is using. In this case, you will need to provide:
`warning:` Remember! Render controllers work based on short-names. If you want to use the cow render controller, you need to provide the short-names it is using. In this case, you will need to provide:
- `default` geometry
- `default` texture
- `default` material
Expand Down

0 comments on commit d8e38ab

Please sign in to comment.