Prevent non-smoothed face normals to participate to smoothed face normals
(cherry picked from commit ec2984f7c7
)
This commit is contained in:
parent
c731cda3d8
commit
c96336449e
1 changed files with 11 additions and 9 deletions
|
@ -296,6 +296,7 @@ void CSGShape::_update_shape() {
|
|||
ERR_CONTINUE(mat < -1 || mat >= face_count.size());
|
||||
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]);
|
||||
|
||||
for (int j = 0; j < 3; j++) {
|
||||
|
@ -308,6 +309,7 @@ void CSGShape::_update_shape() {
|
|||
}
|
||||
vec_map.set(v, add);
|
||||
}
|
||||
}
|
||||
|
||||
face_count.write[idx]++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue