Skip to content

Commit

Permalink
README.md补全计划
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperIceCN committed Apr 21, 2023
1 parent 057ab46 commit 982bcec
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
42 changes: 42 additions & 0 deletions PNXItemRenderer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# PNXItemRenderer

## Usage

```
/render <namespace: string> [manifest|image|mcmod] <renderConfig: file_path>
```

- `namespace`: The namespace or modId of the item, it is used to find the item model and textures
- `manifest|image|mcmod`: The output format, it can be `manifest`, `image` or `mcmod`. If it's not specified, it will be `manifest`
- `renderConfig`: The path to the render config file, it can be a relative path or an absolute path

## Config

```json5
{
"texturePackPath": "resource_packs/xxx.mcpack", // The path to the texture pack, it can be a relative path or an absolute path
"outputPathDir": "plugins/PNXItemRenderer/xxx", // The path to the output directory, it can be a relative path or an absolute path
"renderingTaskList": { // The rendering task list, this field is optional, PIR will complete the rest of the tasks automatically
"xxx:my_item": {
"namespaceId": "xxx:my_item", // Do not change this field, it is used to identify the item and should be the same as the key
"texturePackPath": "resource_packs/xxx.mcpack", // You can override the texture pack path for this task
"inPackTexturePath": { // The path to the textures in the texture pack, it is a relative path in the zipped texture pack file
"up": "textures/items/xxx.png",
"down": "textures/items/xxx.png",
"north": "textures/items/xxx.png",
"south": "textures/items/xxx.png",
"west": "textures/items/xxx.png",
"east": "textures/items/xxx.png",
"any": "textures/items/xxx.png" // If the texture is not found in the other directions, it will use this texture
},
"permutationIndex": 0, // The permutation index of the item, it is used to render the block in different states
"isSingleSide": true, // Whether the item is a single side item, it is used to render transparent blocks
"ambientLight": 0.1, // The ambient light of the item, it is a float value between 0 and 1
"data": {} // extra data that will be copied into the output file
}
}
}
```

Please note that only the `texturePackPath` and `outputPathDir` fields are required, other fields are optional.

27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
# PowerItemRenderer

PowerItemRenderer is a fast and lightweight item renderer for Minecraft.
It is classic raytracing based, but with minecraft-specific optimizations to make it faster.
It is classic raytracing (or sight-casting) based, but with minecraft-specific optimizations to make it faster.

## Features

- 0% code from mojang/microsoft is used or depended on, 100% open-source
- Platform and hardware independent, runs on any OS and any hardware, even if it has no GPU or OpenGL support
- Reasonable performance, it can render more than 100 items per second on a single core
- Native support for Minecraft's (Bedrock) item model format, no need to convert to other formats
- Out of the box support for [PowerNukkitX](https://github.com/PowerNukkitX/PowerNukkitX) engine, but can be used with any other minecraft env
- [McMod](https://www.mcmod.cn/) support, you can export items to McMod format
- CI friendly, you can use it in your CI to generate images for your mods

## Project Structure

- CoreRenderer: The core renderer, it is a library that can be used to render models on any platform with CPU
- PNXItemRenderer: A renderer that uses the CoreRenderer to render items and blocks on [PowerNukkitX](https://github.com/PowerNukkitX/PowerNukkitX)

## License

PowerItemRenderer is licensed under the GNU GENERAL PUBLIC LICENSE Version 3.

## Author

- [Superice666](https://github.com/Superice666)
- [McMod](https://center.mcmod.cn/250680/)
- [MineBBS](https://www.minebbs.com/members/1854/)

0 comments on commit 982bcec

Please sign in to comment.