diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-06-08 14:46:12 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-06-14 15:49:57 +0400 |
commit | b12151eceb76cab4a49f9df661ce6156bbeaaa21 (patch) | |
tree | c2815e24e4bc45e840efc6ff1069684c5c4a3049 /source/blender/nodes/shader | |
parent | ceb68e809edf37ea3fd010692dc3f4367b78cf61 (diff) |
Cycles: glossy and anisotropic BSDF changes
* Anisotropic BSDF now supports GGX and Beckmann distributions, Ward has been
removed because other distributions are superior.
* GGX is now the default distribution for all glossy and anisotropic nodes,
since it looks good, has low noise and is fast to evaluate.
* Ashikhmin-Shirley is now available in the Glossy BSDF.
Diffstat (limited to 'source/blender/nodes/shader')
4 files changed, 24 insertions, 4 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c index dd14006cd8a..b9c94fc3aee 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c @@ -44,6 +44,11 @@ static bNodeSocketTemplate sh_node_bsdf_anisotropic_out[] = { { -1, 0, "" } }; +static void node_shader_init_anisotropic(bNodeTree *UNUSED(ntree), bNode *node) +{ + node->custom1 = SHD_GLOSSY_GGX; +} + static int node_shader_gpu_bsdf_anisotropic(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) { if (!in[3].link) @@ -61,7 +66,7 @@ void register_node_type_sh_bsdf_anisotropic(void) node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_anisotropic_in, sh_node_bsdf_anisotropic_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, NULL); + node_type_init(&ntype, node_shader_init_anisotropic); node_type_storage(&ntype, "", NULL, NULL); node_type_gpu(&ntype, node_shader_gpu_bsdf_anisotropic); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c index a59cbd6f46e..55dafaeca35 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c @@ -42,6 +42,11 @@ static bNodeSocketTemplate sh_node_bsdf_glass_out[] = { { -1, 0, "" } }; +static void node_shader_init_glass(bNodeTree *UNUSED(ntree), bNode *node) +{ + node->custom1 = SHD_GLOSSY_BECKMANN; +} + static int node_shader_gpu_bsdf_glass(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) { if (!in[3].link) @@ -59,7 +64,7 @@ void register_node_type_sh_bsdf_glass(void) node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_glass_in, sh_node_bsdf_glass_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, NULL); + node_type_init(&ntype, node_shader_init_glass); node_type_storage(&ntype, "", NULL, NULL); node_type_gpu(&ntype, node_shader_gpu_bsdf_glass); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c index b8ad5e4fbed..9518784eebe 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c @@ -41,6 +41,11 @@ static bNodeSocketTemplate sh_node_bsdf_glossy_out[] = { { -1, 0, "" } }; +static void node_shader_init_glossy(bNodeTree *UNUSED(ntree), bNode *node) +{ + node->custom1 = SHD_GLOSSY_GGX; +} + static int node_shader_gpu_bsdf_glossy(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) { if (!in[2].link) @@ -58,7 +63,7 @@ void register_node_type_sh_bsdf_glossy(void) node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_glossy_in, sh_node_bsdf_glossy_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, NULL); + node_type_init(&ntype, node_shader_init_glossy); node_type_storage(&ntype, "", NULL, NULL); node_type_gpu(&ntype, node_shader_gpu_bsdf_glossy); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c index 5d1bcc81adb..90db7a5771d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c @@ -42,6 +42,11 @@ static bNodeSocketTemplate sh_node_bsdf_refraction_out[] = { { -1, 0, "" } }; +static void node_shader_init_refraction(bNodeTree *UNUSED(ntree), bNode *node) +{ + node->custom1 = SHD_GLOSSY_BECKMANN; +} + static int node_shader_gpu_bsdf_refraction(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) { if (!in[3].link) @@ -59,7 +64,7 @@ void register_node_type_sh_bsdf_refraction(void) node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_refraction_in, sh_node_bsdf_refraction_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, NULL); + node_type_init(&ntype, node_shader_init_refraction); node_type_storage(&ntype, "", NULL, NULL); node_type_gpu(&ntype, node_shader_gpu_bsdf_refraction); |