Skip to content

Commit

Permalink
UPBGE: Avoid to use Burley BSDF when roughness is connected
Browse files Browse the repository at this point in the history
  • Loading branch information
lordloki committed May 16, 2020
1 parent 86841ea commit e8abf7a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions source/blender/nodes/shader/nodes/node_shader_material.c
Expand Up @@ -95,11 +95,15 @@ static void node_shader_exec_material(void *data, int UNUSED(thread), bNode *nod
shi = shcd->shi;
shi->mat = (Material *)node->id;

if (hasinput[MAT_IN_ROUGHNESS] || hasinput[MAT_IN_METALLIC]) {
shi->mat->diff_shader = MA_DIFF_BURLEY_BSDF;
if (hasinput[MAT_IN_ROUGHNESS]) {
if (shi->mat->diff_shader != MA_DIFF_LAMBERT_CUSTOM_BSDF) {
shi->mat->diff_shader = MA_DIFF_BURLEY_BSDF;
}
}
if (hasinput[MAT_IN_METALLIC]) {
shi->mat->spec_shader = MA_SPEC_GGX_BSDF;
}

/* copy all relevant material vars, note, keep this synced with render_types.h */
memcpy(&shi->r, &shi->mat->r, 23 * sizeof(float));
shi->har = shi->mat->har;
Expand Down

0 comments on commit e8abf7a

Please sign in to comment.