Skip to content

Commit f0f5013

Browse files
committed
core/v1db/prepmesh: handle shading modes for Croc in Smoothing()
1 parent e7d4b1c commit f0f5013

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/v1db/prepmesh.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ static void Smoothing(br_model *model, br_scalar crease_limit, struct prep_verte
362362
/*
363363
* Kludge normals on all flat shaded faces
364364
*/
365-
if(model->faces[(*outer)->f].material != NULL && !(model->faces[(*outer)->f].material->flags & BR_MATF_SMOOTH)) {
365+
br_material *croc_mat = model->faces[(*outer)->f].material;
366+
if(croc_mat != NULL && !(croc_mat->flags & BR_MATF_SMOOTH) && ((croc_mat->mode & BR_MATM_SHADING_MODE_MASK) == BR_MATM_SHADING_MODE_FLAT)) {
366367
BrVector3CopyF(&(*outer)->n, &model->faces[(*outer)->f].n);
367368
} else
368369
#endif

0 commit comments

Comments
 (0)