Merge commit 'b191ae0' into feat/p1-p3-integration
Native and manual checks / native (ubuntu-24.04) (push) Failing after 31s
Windows editor and software Vulkan / windows-graphics (push) Canceled after 0s
Native and manual checks / manual (push) Successful in 28s
Native and manual checks / native (windows-2025) (push) Canceled after 0s
Native and manual checks / native (ubuntu-24.04) (push) Failing after 31s
Windows editor and software Vulkan / windows-graphics (push) Canceled after 0s
Native and manual checks / manual (push) Successful in 28s
Native and manual checks / native (windows-2025) (push) Canceled after 0s
This commit is contained in:
@@ -156,6 +156,15 @@ void SchemaRegistry::validate_component(const Json& component) const {
|
||||
for (const auto& [id, value] : component["fields"].items())
|
||||
if (metadata["fields"].contains(id))
|
||||
validate_field(value, metadata["fields"][id]);
|
||||
if (type == "faset.light") {
|
||||
auto effective = default_fields(type);
|
||||
effective.update(component.at("fields"));
|
||||
if (effective.at("kind") == "spot")
|
||||
require(effective.at("inner_angle").get<double>() <=
|
||||
effective.at("outer_angle").get<double>(),
|
||||
"validation.light_cone",
|
||||
"Spotlight inner_angle must not exceed outer_angle");
|
||||
}
|
||||
}
|
||||
void SchemaRegistry::add_migration(const std::string& type, int from_version, Json rules) {
|
||||
require(contains(type) && from_version > 0 && from_version < schema(type).value("version", 1) &&
|
||||
@@ -252,9 +261,25 @@ SchemaRegistry builtin_schemas() {
|
||||
{{"fov", Json{{"type", "number"}, {"default", 60.0}, {"min", 1.0}, {"max", 179.0}}},
|
||||
{"near", Json{{"type", "number"}, {"default", 0.1}, {"min", 0.001}}},
|
||||
{"far", Json{{"type", "number"}, {"default", 1000.0}, {"min", 0.01}}}});
|
||||
add("faset.light", "Directional Light",
|
||||
{{"color", field("color", {1, 1, 1, 1})},
|
||||
{"intensity", Json{{"type", "number"}, {"default", 1.0}, {"min", 0.0}}}});
|
||||
add("faset.light", "Light",
|
||||
{{"kind", Json{{"type", "string"},
|
||||
{"default", "directional"},
|
||||
{"enum", {"directional", "point", "spot"}}}},
|
||||
{"enabled", field("boolean", true)},
|
||||
{"color", field("color", {1, 1, 1, 1})},
|
||||
{"intensity", Json{{"type", "number"}, {"default", 1.0}, {"min", 0.0}}},
|
||||
{"range", Json{{"type", "number"}, {"default", 10.0}, {"min", 0.001}}},
|
||||
{"inner_angle", Json{{"type", "number"},
|
||||
{"default", 0.35}, {"min", 0.0}, {"max", 1.55},
|
||||
{"unit", "radians"}}},
|
||||
{"outer_angle", Json{{"type", "number"},
|
||||
{"default", 0.7}, {"min", 0.001}, {"max", 1.55},
|
||||
{"unit", "radians"}}},
|
||||
{"casts_shadow", field("boolean", true)},
|
||||
{"shadow_priority", Json{{"type", "integer"},
|
||||
{"default", 0},
|
||||
{"min", std::numeric_limits<int>::min()},
|
||||
{"max", std::numeric_limits<int>::max()}}}});
|
||||
for (int dimension : {2, 3}) {
|
||||
Json vector = dimension == 2 ? Json{0, 0} : Json{0, 0, 0};
|
||||
Json extents = dimension == 2 ? Json{0.5, 0.5} : Json{0.5, 0.5, 0.5};
|
||||
|
||||
Reference in New Issue
Block a user