fix custom models shading flag & add more properties to vcm

This commit is contained in:
MihailRis
2025-07-13 18:51:53 +03:00
parent 57a9a26c23
commit 3e59b186d3
6 changed files with 40 additions and 16 deletions
+3 -3
View File
@@ -70,7 +70,7 @@ void ModelBatch::draw(
const auto& vertexData = mesh.vertices.data();
glm::vec4 lights(1, 1, 1, 0);
if (mesh.lighting) {
if (mesh.shading) {
glm::vec3 gpos = matrix * glm::vec4(0.0f, 0.0f, 0.0f, 1.0f);
gpos += lightsOffset;
lights = MainBatch::sampleLight(gpos, chunks, backlight);
@@ -81,7 +81,7 @@ void ModelBatch::draw(
const auto vert = vertexData[i * 3 + j];
float d = 1.0f;
auto norm = rotation * vert.normal;
if (mesh.lighting) {
if (mesh.shading) {
d = glm::dot(norm, SUN_VECTOR);
d = 0.8f + d * 0.2f;
}
@@ -91,7 +91,7 @@ void ModelBatch::draw(
lights * d,
tint,
norm,
mesh.lighting ? 0.0f : 1.0f
mesh.shading ? 0.0f : 1.0f
);
}
}