diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-06-30 15:12:25 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-06-30 15:12:25 +0300 |
commit | 08310996645f0afb5d1d6ecd4c6b41a2ab22cd89 (patch) | |
tree | 5ce714e3c322c0fc887231bf4985c682e63f2076 /source/blender/nodes | |
parent | 178c470c43870adae4bfdcb6d03e1657a6f98f43 (diff) |
Eevee: Principled BSDF: add support for specular tint + optimisation
Only use clearcoat version if there is something linked or if the clearcoat value is not 0.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c index c3940573a29..7e90397dc50 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c @@ -98,7 +98,13 @@ static int node_shader_gpu_bsdf_principled(GPUMaterial *mat, bNode *UNUSED(node) &in[19].link); } - return GPU_stack_link(mat, "node_bsdf_principled", in, out, GPU_builtin(GPU_VIEW_POSITION)); + /* Only use complex versions when needed. */ + if (!in[12].link && (in[12].vec[0] == 0.0f)) { + return GPU_stack_link(mat, "node_bsdf_principled_simple", in, out, GPU_builtin(GPU_VIEW_POSITION)); + } + else { + return GPU_stack_link(mat, "node_bsdf_principled_clearcoat", in, out, GPU_builtin(GPU_VIEW_POSITION)); + } } static void node_shader_update_principled(bNodeTree *UNUSED(ntree), bNode *node) |