mirror of https://github.com/godotengine/godot
Prevent non-smoothed face normals to participate to smoothed face normals
This commit is contained in:
parent
f94ada39b3
commit
ec2984f7c7
|
|
@ -303,6 +303,7 @@ void CSGShape3D::_update_shape() {
|
||||||
ERR_CONTINUE(mat < -1 || mat >= face_count.size());
|
ERR_CONTINUE(mat < -1 || mat >= face_count.size());
|
||||||
int idx = mat == -1 ? face_count.size() - 1 : mat;
|
int idx = mat == -1 ? face_count.size() - 1 : mat;
|
||||||
|
|
||||||
|
if (n->faces[i].smooth) {
|
||||||
Plane p(n->faces[i].vertices[0], n->faces[i].vertices[1], n->faces[i].vertices[2]);
|
Plane p(n->faces[i].vertices[0], n->faces[i].vertices[1], n->faces[i].vertices[2]);
|
||||||
|
|
||||||
for (int j = 0; j < 3; j++) {
|
for (int j = 0; j < 3; j++) {
|
||||||
|
|
@ -315,6 +316,7 @@ void CSGShape3D::_update_shape() {
|
||||||
}
|
}
|
||||||
vec_map.set(v, add);
|
vec_map.set(v, add);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
face_count.write[idx]++;
|
face_count.write[idx]++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue