mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
fix custom models shading flag & add more properties to vcm
This commit is contained in:
parent
57a9a26c23
commit
3e59b186d3
6 changed files with 40 additions and 16 deletions
|
|
@ -97,7 +97,7 @@ model::Model ModelsGenerator::fromCustom(
|
|||
auto model = model::Model();
|
||||
for (size_t i = 0; i < modelBoxes.size(); i++) {
|
||||
auto& mesh = model.addMesh("blocks:");
|
||||
mesh.lighting = lighting;
|
||||
mesh.shading = lighting;
|
||||
UVRegion boxtexfaces[6] = {
|
||||
get_region_for(modelTextures[i * 6 + 5], assets),
|
||||
get_region_for(modelTextures[i * 6 + 4], assets),
|
||||
|
|
@ -132,7 +132,7 @@ model::Model ModelsGenerator::fromCustom(
|
|||
norm = glm::normalize(norm);
|
||||
|
||||
auto& mesh = model.addMesh(texture);
|
||||
mesh.lighting = lighting;
|
||||
mesh.shading = lighting;
|
||||
|
||||
auto reg = get_region_for(texture, assets);
|
||||
mesh.vertices.push_back({v0, glm::vec2(reg.u1, reg.v1), norm});
|
||||
|
|
@ -163,7 +163,7 @@ model::Model ModelsGenerator::generate(
|
|||
return model;
|
||||
}
|
||||
for (auto& mesh : model.meshes) {
|
||||
mesh.lighting = !blockDef.shadeless;
|
||||
mesh.shading = !blockDef.shadeless;
|
||||
switch (blockDef.model.type) {
|
||||
case BlockModelType::AABB: {
|
||||
glm::vec3 size = blockDef.hitboxes.at(0).size();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue