Skip to content

Commit e8abf7a

Browse files
committedMay 16, 2020
UPBGE: Avoid to use Burley BSDF when roughness is connected
1 parent 86841ea commit e8abf7a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed
 

‎source/blender/nodes/shader/nodes/node_shader_material.c

+7-3
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,15 @@ static void node_shader_exec_material(void *data, int UNUSED(thread), bNode *nod
9595
shi = shcd->shi;
9696
shi->mat = (Material *)node->id;
9797

98-
if (hasinput[MAT_IN_ROUGHNESS] || hasinput[MAT_IN_METALLIC]) {
99-
shi->mat->diff_shader = MA_DIFF_BURLEY_BSDF;
98+
if (hasinput[MAT_IN_ROUGHNESS]) {
99+
if (shi->mat->diff_shader != MA_DIFF_LAMBERT_CUSTOM_BSDF) {
100+
shi->mat->diff_shader = MA_DIFF_BURLEY_BSDF;
101+
}
102+
}
103+
if (hasinput[MAT_IN_METALLIC]) {
100104
shi->mat->spec_shader = MA_SPEC_GGX_BSDF;
101105
}
102-
106+
103107
/* copy all relevant material vars, note, keep this synced with render_types.h */
104108
memcpy(&shi->r, &shi->mat->r, 23 * sizeof(float));
105109
shi->har = shi->mat->har;

0 commit comments

Comments
 (0)
Please sign in to comment.