Skip to content

Commit

Permalink
Adding deferred lightning schemas (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanV2 authored May 11, 2024
1 parent 5844e7d commit 03d02a4
Show file tree
Hide file tree
Showing 5 changed files with 223 additions and 0 deletions.
67 changes: 67 additions & 0 deletions source/behavior/lighting/atmospherics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"$id": "blockception.minecraft.behavior.lighting.atmospherics",
"type": "object",
"title": "Atmospherics",
"description": "The properties of the atmosphere",
"additionalProperties": false,
"properties": {
"horizon_blend_stops": {
"type": "object",
"title": "Horizon Blend Stops",
"description": "How the atmosphere is divided up",
"additionalProperties": false,
"properties": {
"min": {
"title": "Minimum Horizon Height",
"description": "The minimum horizon height",
"type": "number"
},
"start": {
"title": "Start",
"description": "The height relative to the horizon where the zenith contribution will take over",
"type": "number"
},
"mie_start": {
"title": "Mie Start",
"description": "The height relative to the horizon where mie scattering begins",
"type": "number"
},
"max": {
"title": "Maximum Horizon Height",
"description": "The maximum horizon height",
"type": "number"
}
}
},
"rayleigh_strength": {
"title": "Rayleigh Strength",
"description": "How strong the atmosphere's rayleigh scattering term is",
"type": "number"
},
"sun_mie_strength": {
"title": "Sun Mie Strength",
"description": "How strong the sun's mie scattering term is",
"type": "number"
},
"moon_mie_strength": {
"title": "Moon Mie Strength",
"description": "How strong the moon's mie scattering term is",
"type": "number"
},
"sun_glare_shape": {
"title": "Sun Glare Shape",
"description": "How the lobe of the mie scattering is shaped",
"type": "number"
},
"sky_zenith_color": {
"title": "Sky Zenith Color",
"description": "The RGB color of the zenith region of the atmosphere",
"$ref": "./color.json"
},
"sky_horizon_color": {
"title": "Sky Horizon Color",
"description": "The RGB color of the horizon region of the atmosphere",
"$ref": "./color.json"
}
}
}
20 changes: 20 additions & 0 deletions source/behavior/lighting/color.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$id": "blockception.minecraft.behavior.lighting.color",
"title": "Lighting Color",
"description": "The color of the light emitted by the block, in RGB format or hex format.",
"oneOf": [
{
"type": "string",
"format": "color-hex",
"examples": ["#FFFFFF", "#000000"]
},
{
"type": "array",
"items": [
{ "title": "Red", "type": "integer", "minimum": 0, "maximum": 255 },
{ "title": "Blue", "type": "integer", "minimum": 0, "maximum": 255 },
{ "title": "Green", "type": "integer", "minimum": 0, "maximum": 255 }
]
}
]
}
126 changes: 126 additions & 0 deletions source/behavior/lighting/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{
"$id": "blockception.minecraft.behavior.lighting.global",
"type": "object",
"additionalProperties": false,
"properties": {
"format_version": { "$ref": "../../general/format_version.json" },
"directional_lights": {
"type": "object",
"additionalProperties": false,
"title": "Directional Lights",
"description": "The directional lights that affect the world",
"properties": {
"sun": {
"type": "object",
"title": "Sun",
"description": "The sun directional light",
"additionalProperties": false,
"properties": {
"illuminance": {
"type": "number",
"title": "Illuminance",
"description": "How bright the sun is, measured in lux (lx)"
},
"color": {
"title": "Color",
"description": "The RGB color that the sun contributes to direct surface lighting; supports RGB array or HEX string",
"$ref": "./color.json"
}
}
},
"moon": {
"type": "object",
"title": "Moon",
"description": "The moon directional light",
"additionalProperties": false,
"properties": {
"illuminance": {
"type": "number",
"title": "Illuminance",
"description": "How bright the moon is, measured in lux (lx)"
},
"color": {
"title": "Color",
"description": "The RGB color that the moon contributes to direct surface lighting; supports RGB array or HEX string",
"$ref": "./color.json"
}
}
},
"orbital_offset_degrees": {
"type": "number",
"title": "Orbital Offset Degrees",
"description": "The rotational offset of the sun and moon from their standard orbital axis; measured in degrees"
},
"point_lights": {
"type": "object",
"title": "Point Lights",
"description": "The point lights that affect the world",
"additionalProperties": false,
"properties": {
"colors": {
"type": "object",
"title": "Colors",
"description": "List of key-value pairs where the key is a namespace-qualified block name and the value is a color",
"additionalProperties": {
"$ref": "./color.json"
},
"examples": [
{
"minecraft:stone": "#ffffff",
"minecraft:grass": [0, 255, 0]
}
]
}
}
},
"pbr": {
"title": "PBR",
"description": "The physically-based rendering properties for the world",
"type": "object",
"additionalProperties": false,
"properties": {
"blocks": {
"title": "Blocks",
"description": "The PBR properties for blocks",
"type": "object",
"additionalProperties": false,
"properties": {
"color": {
"title": "Color",
"description": "The default MER value to use for blocks when not defined via textureset; supports RGB array or HEX string",
"$ref": "./color.json"
}
}
},
"actors": {
"title": "Actors",
"description": "The PBR properties for actors",
"type": "object",
"additionalProperties": false,
"properties": {
"color": {
"title": "Color",
"description": "The default MER value to use for actors/mobs when not defined via textureset; supports RGB array or HEX string",
"$ref": "./color.json"
}
}
},
"particles": {
"title": "Particles",
"description": "The PBR properties for particles",
"type": "object",
"additionalProperties": false,
"properties": {
"color": {
"title": "Color",
"description": "The default MER value to use for particles when not defined via textureset; supports RGB array or HEX string",
"$ref": "./color.json"
}
}
}
}
}
}
}
}
}
2 changes: 2 additions & 0 deletions source/compress_specification.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
{ "Source": "./behavior/features/features.json", "Destination": "../behavior/features/features.json" },
{ "Source": "./behavior/functions/tick.json", "Destination": "../behavior/functions/tick.json" },
{ "Source": "./behavior/items/items.json", "Destination": "../behavior/items/items.json" },
{ "Source": "./behavior/lighting/global.json", "Destination": "../behavior/lighting/global.json" },
{ "Source": "./behavior/lighting/atmospherics.json", "Destination": "../behavior/lighting/atmospherics.json" },
{ "Source": "./behavior/loot_tables/loot_tables.json", "Destination": "../behavior/loot_tables/loot_tables.json" },
{ "Source": "./behavior/recipes/recipes.json", "Destination": "../behavior/recipes/recipes.json" },
{ "Source": "./behavior/spawn_rules/spawn_rules.json", "Destination": "../behavior/spawn_rules/spawn_rules.json" },
Expand Down
8 changes: 8 additions & 0 deletions vscode-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,14 @@
],
"url": "https://raw.githubusercontent.com/Blockception/Minecraft-bedrock-json-schemas/main/behavior/feature_rules/feature_rules.json"
},
{
"fileMatch": ["lighting/global.json"],
"url": "https://raw.githubusercontent.com/Blockception/Minecraft-bedrock-json-schemas/main/behavior/lighting/global.json"
},
{
"fileMatch": ["lighting/atmospherics.json"],
"url": "https://raw.githubusercontent.com/Blockception/Minecraft-bedrock-json-schemas/main/behavior/lighting/atmospherics.json"
},
{
"fileMatch": [
"behavior_packs/*/items/*.{json,jsonc,json5}",
Expand Down

0 comments on commit 03d02a4

Please sign in to comment.