Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Texture Set Schema #266

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ JSON validation can give snippets for sub items, as well as description, but thi
- [Sounds](resource/sounds/sound_definitions.json)
- [Terrain texture](resource/textures/terrain_texture.json)
- [Terrain list](resource/textures/texture_list.json)
- [Texture Set](resource/textures/texture_set.json)

## License

Expand Down
1 change: 1 addition & 0 deletions source/compress_specification.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
{ "Source": "./resource/textures/flipbook_textures.json", "Destination": "../resource/textures/flipbook_textures.json" },
{ "Source": "./resource/textures/item_texture.json", "Destination": "../resource/textures/item_texture.json" },
{ "Source": "./resource/textures/texture_list.json", "Destination": "../resource/textures/texture_list.json" },
{ "Source": "./resource/textures/texture_set.json", "Destination": "../resource/textures/texture_set.json" },
{ "Source": "./resource/items/items.json", "Destination": "../resource/items/items.json" },
{ "Source": "./resource/models/entity/model_entity.json", "Destination": "../resource/models/entity/model_entity.json" },
{ "Source": "./resource/materials/materials.json", "Destination": "../resource/materials/materials.json" },
Expand Down
111 changes: 111 additions & 0 deletions source/resource/textures/texture_set.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "blockception.minecraft.resource.texture.texture_set",
"type": "object",
"additionalProperties": false,
"properties": {
"format_version": { "$ref": "../../general/format_version.json" },
"minecraft:texture_set": {
"title": "Texture Set",
"description": "Texture Sets are used to define multiple PBR layers for a texture resource.",
"type": "object",
"additionalProperties": false,
"required": ["color"],
"properties": {
"color": { "$ref": "#/definitions/color" },
"heightmap": { "$ref": "#/definitions/heightmap" },
"metalness_emissive_roughness": { "$ref": "#/definitions/mer" },
"normal": { "$ref": "#/definitions/normal" }
}
}
},
"definitions": {
"color": {
"title": "Color",
"description": "This is an RGB 3-channel image (defaults to uniform alpha of 1.0), or an RGBA 4-channel image, or a 4 value array for a uniform color with alpha.",
"examples": [[255, 255, 255, 255]],
"oneOf": [
{ "type": "string" },
{
"type": "array",
"items": [
{
"title": "Red",
"type": "integer",
"minimum": 0,
"maximum": 255
},
{
"title": "Green",
"type": "integer",
"minimum": 0,
"maximum": 255
},
{
"title": "Blue",
"type": "integer",
"minimum": 0,
"maximum": 255
},
{
"title": "Alpha",
"type": "integer",
"default": 255,
"minimum": 0,
"maximum": 255
}
]
}
]
},
"normal": {
"title": "Normal Map",
"description": "This is a 3-channel normal map image (or 4-channel where the 4th channel is ignored). This layer and the \"heightmap\" layer should not both be defined at the same time.",
"type": "string"
},
"heightmap": {
"title": "Heightmap",
"description": "1-channel layer image or a single value in this JSON file for a uniform heightmap. This layer and the \"normal\" layer should not both be defined at the same time.",
"examples": [255],
"oneOf": [
{ "type": "string" },
{
"type": "integer",
"minimum": 0,
"maximum": 255
}
]
},
"mer": {
"title": "Metalness Emissive Roughness",
"description": "This is a 3-channel image (or 4-channel where the 4th channel is ignored) or a 3-value array for a uniform MER. RGB images map Red to Metalness, Green to Emissive, and Blue to Roughness.",
"examples": [[255, 255, 255]],
"oneOf": [
{ "type": "string" },
{
"type": "array",
"items": [
{
"title": "Red",
"type": "integer",
"minimum": 0,
"maximum": 255
},
{
"title": "Green",
"type": "integer",
"minimum": 0,
"maximum": 255
},
{
"title": "Blue",
"type": "integer",
"minimum": 0,
"maximum": 255
}
]
}
]
}
}
}
4 changes: 4 additions & 0 deletions vscode-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@
"fileMatch": ["texture_list.{json,jsonc,json5}"],
"url": "https://raw.githubusercontent.com/Blockception/Minecraft-bedrock-json-schemas/main/resource/textures/texture_list.json"
},
{
"fileMatch": ["*.texture_set.{json,jsonc,json5}"],
"url": "https://raw.githubusercontent.com/Blockception/Minecraft-bedrock-json-schemas/main/resource/textures/texture_set.json"
},
{
"fileMatch": [
"resource_packs/*/items/*.{json,jsonc,json5}",
Expand Down
Loading