[Bf-blender-cvs] [1bc0cd00713] blender2.8: Merge branch 'master' into blender2.8

Brecht Van Lommel noreply at git.blender.org
Sat Feb 3 16:18:28 CET 2018


Commit: 1bc0cd00713a573bed76ab35b6ae0cc0e9edc307
Author: Brecht Van Lommel
Date:   Sat Feb 3 16:10:01 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB1bc0cd00713a573bed76ab35b6ae0cc0e9edc307

Merge branch 'master' into blender2.8

===================================================================



===================================================================

diff --cc release/datafiles/locale
index cd65bc3277e,469c949d1ca..c93ed11a47b
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit cd65bc3277eda27e1c0b9f20a25928f6586d89a8
 -Subproject commit 469c949d1ca882be19daa128842f813b72a944d8
++Subproject commit c93ed11a47b3016cf59711ec16de2e2e94c30e99
diff --cc release/scripts/addons
index f5536e5e49c,c88411ff777..371960484a3
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit f5536e5e49c34dfc0a7b8990257cd393339e23c6
 -Subproject commit c88411ff7776a2db5d6ef6117a1b2faa42a95611
++Subproject commit 371960484a38fc64e0a2635170a41a0d8ab2f6bd
diff --cc release/scripts/addons_contrib
index 310578043de,310578043de..a8515cfdfe9
--- a/release/scripts/addons_contrib
+++ b/release/scripts/addons_contrib
@@@ -1,1 -1,1 +1,1 @@@
--Subproject commit 310578043dec1aae382eb6a447ae1d103792d7e6
++Subproject commit a8515cfdfe9a98127b592f36fcbe51b7e23b969a
diff --cc source/blender/blenkernel/BKE_node.h
index 4e30cb076d4,8a736c9952d..770b2b4a185
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@@ -798,9 -789,9 +798,10 @@@ struct ShadeResult
  #define SH_NODE_UVALONGSTROKE			191
  #define SH_NODE_TEX_POINTDENSITY		192
  #define SH_NODE_BSDF_PRINCIPLED         193
 +#define SH_NODE_EEVEE_SPECULAR			195
  #define SH_NODE_BEVEL                   197
  #define SH_NODE_DISPLACEMENT            198
+ #define SH_NODE_VECTOR_DISPLACEMENT     199
  
  /* custom defines options for Material node */
  #define SH_NODE_MAT_DIFF   1
diff --cc source/blender/nodes/shader/nodes/node_shader_displacement.c
index d5c191b3966,e976eaf143a..25aee34f0ab
--- a/source/blender/nodes/shader/nodes/node_shader_displacement.c
+++ b/source/blender/nodes/shader/nodes/node_shader_displacement.c
@@@ -41,13 -42,30 +42,30 @@@ static bNodeSocketTemplate sh_node_disp
  	{	-1, 0, ""	}
  };
  
+ static void node_shader_init_displacement(bNodeTree *UNUSED(ntree), bNode *node)
+ {
+ 	node->custom1 = SHD_SPACE_OBJECT; /* space */
+ 
+ 	/* Set default value here for backwards compatibility. */
+ 	for (bNodeSocket *sock = node->inputs.first; sock; sock = sock->next) {
+ 		if (STREQ(sock->name, "Midlevel")) {
+ 			((bNodeSocketValueFloat *)sock->default_value)->value = 0.5f;
+ 		}
+ 	}
+ }
+ 
  static int gpu_shader_displacement(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
  {
- 	if (!in[2].link) {
- 		GPU_link(mat, "direction_transform_m4v3", GPU_builtin(GPU_VIEW_NORMAL), GPU_builtin(GPU_INVERSE_VIEW_MATRIX), &in[2].link);
+ 	if (!in[3].link) {
+ 		GPU_link(mat, "direction_transform_m4v3", GPU_builtin(GPU_VIEW_NORMAL), GPU_builtin(GPU_INVERSE_VIEW_MATRIX), &in[3].link);
  	}
  
- 	return GPU_stack_link(mat, node, "node_displacement", in, out);
+ 	if(node->custom1 == SHD_SPACE_OBJECT) {
 -		return GPU_stack_link(mat, "node_displacement_object", in, out, GPU_builtin(GPU_OBJECT_MATRIX));
++		return GPU_stack_link(mat, node, "node_displacement_object", in, out, GPU_builtin(GPU_OBJECT_MATRIX));
+ 	}
+ 	else {
 -		return GPU_stack_link(mat, "node_displacement_world", in, out, GPU_builtin(GPU_OBJECT_MATRIX));
++		return GPU_stack_link(mat, node, "node_displacement_world", in, out, GPU_builtin(GPU_OBJECT_MATRIX));
+ 	}
  }
  
  /* node type definition */
diff --cc source/blender/nodes/shader/nodes/node_shader_vector_displacement.c
index 00000000000,c40377c3d59..c864a606812
mode 000000,100644..100644
--- a/source/blender/nodes/shader/nodes/node_shader_vector_displacement.c
+++ b/source/blender/nodes/shader/nodes/node_shader_vector_displacement.c
@@@ -1,0 -1,82 +1,83 @@@
+ /*
+  * ***** BEGIN GPL LICENSE BLOCK *****
+  *
+  * This program is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU General Public License
+  * as published by the Free Software Foundation; either version 2
+  * of the License, or (at your option) any later version.
+  *
+  * This program is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  * GNU General Public License for more details.
+  *
+  * You should have received a copy of the GNU General Public License
+  * along with this program; if not, write to the Free Software Foundation,
+  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+  *
+  * The Original Code is Copyright (C) 2005 Blender Foundation.
+  * All rights reserved.
+  *
+  * The Original Code is: all of this file.
+  *
+  * Contributor(s): none yet.
+  *
+  * ***** END GPL LICENSE BLOCK *****
+  */
+ 
+ #include "../node_shader_util.h"
+ 
+ /* **************** OUTPUT ******************** */
+ 
+ static bNodeSocketTemplate sh_node_vector_displacement_in[] = {
+ 	{	SOCK_RGBA, 0, N_("Vector"), 0.00f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f, PROP_NONE, SOCK_HIDE_VALUE},
+ 	{	SOCK_FLOAT, 0, N_("Midlevel"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f},
+ 	{	SOCK_FLOAT, 0, N_("Scale"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f},
+ 	{	-1, 0, ""	}
+ };
+ 
+ static bNodeSocketTemplate sh_node_vector_displacement_out[] = {
+ 	{	SOCK_VECTOR, 0, N_("Displacement"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+ 	{	-1, 0, ""	}
+ };
+ 
+ static void node_shader_init_vector_displacement(bNodeTree *UNUSED(ntree), bNode *node)
+ {
+ 	node->custom1 = SHD_SPACE_TANGENT; /* space */
+ }
+ 
+ static int gpu_shader_vector_displacement(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
+ {
+ 	if(node->custom1 == SHD_SPACE_TANGENT) {
+ 		return GPU_stack_link(mat,
++		                      node,
+ 		                      "node_vector_displacement_tangent",
+ 		                      in,
+ 		                      out,
+ 		                      GPU_attribute(CD_TANGENT, ""),
+ 		                      GPU_builtin(GPU_VIEW_NORMAL),
+ 		                      GPU_builtin(GPU_OBJECT_MATRIX),
+ 		                      GPU_builtin(GPU_VIEW_MATRIX));
+ 	}
+ 	else if(node->custom1 == SHD_SPACE_OBJECT) {
 -		return GPU_stack_link(mat, "node_vector_displacement_object", in, out, GPU_builtin(GPU_OBJECT_MATRIX));
++		return GPU_stack_link(mat, node, "node_vector_displacement_object", in, out, GPU_builtin(GPU_OBJECT_MATRIX));
+ 	}
+ 	else {
 -		return GPU_stack_link(mat, "node_vector_displacement_world", in, out);
++		return GPU_stack_link(mat, node, "node_vector_displacement_world", in, out);
+ 	}
+ }
+ 
+ /* node type definition */
+ void register_node_type_sh_vector_displacement(void)
+ {
+ 	static bNodeType ntype;
+ 
+ 	sh_node_type_base(&ntype, SH_NODE_VECTOR_DISPLACEMENT, "Vector Displacement", NODE_CLASS_OP_VECTOR, 0);
+ 	node_type_compatibility(&ntype, NODE_NEW_SHADING);
+ 	node_type_socket_templates(&ntype, sh_node_vector_displacement_in, sh_node_vector_displacement_out);
+ 	node_type_storage(&ntype, "", NULL, NULL);
+ 	node_type_init(&ntype, node_shader_init_vector_displacement);
+ 	node_type_gpu(&ntype, gpu_shader_vector_displacement);
+ 
+ 	nodeRegisterType(&ntype);
+ }
diff --cc source/tools
index ccf20e08702,7695e14cfc5..b11375e8906
--- a/source/tools
+++ b/source/tools
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit ccf20e08702ee6424edbda01544bb9f8bc386de4
 -Subproject commit 7695e14cfc5820ac66546e0e515914d85ab81af3
++Subproject commit b11375e89061303401376f7aeae42ac2fd64692a



More information about the Bf-blender-cvs mailing list