diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-08-17 16:54:05 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-08-18 18:00:45 +0300 |
commit | e8f0ee157b290e41258bf704d63c00cb2d4d2a90 (patch) | |
tree | a3a01967ef754061897d5fd77bc51015d627ddb0 /source | |
parent | 8ab6e8aad623a08c25c45e6dfd91804b1be09ae6 (diff) |
Swap Eevee material output with (Cycles) Material Output
Since we started supporting the (Cycles) Material Output old files
stopped working. There is no reason to keep the original Eevee material
otuput anymore.
It includes doversion for old files.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_node.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 1 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 9 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 2 | ||||
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_material.glsl | 5 | ||||
-rw-r--r-- | source/blender/nodes/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/nodes/NOD_static_types.h | 1 | ||||
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_output_eevee_material.c | 66 |
8 files changed, 9 insertions, 77 deletions
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index dc61a2d825f..fd690a917a0 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -798,7 +798,6 @@ struct ShadeResult; #define SH_NODE_BSDF_PRINCIPLED 193 #define SH_NODE_EEVEE_METALLIC 194 #define SH_NODE_EEVEE_SPECULAR 195 -#define SH_NODE_OUTPUT_EEVEE_MATERIAL 196 /* custom defines options for Material node */ #define SH_NODE_MAT_DIFF 1 diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 346d107792e..d53fe68eb99 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -3599,7 +3599,6 @@ static void registerShaderNodes(void) register_node_type_sh_output_lamp(); register_node_type_sh_output_material(); - register_node_type_sh_output_eevee_material(); register_node_type_sh_output_world(); register_node_type_sh_output_linestyle(); diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 1c7ecc9ce3b..ce452d58565 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -446,10 +446,17 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main) error = true; } - if (node->type == SH_NODE_EEVEE_SPECULAR && STREQ(node->idname, "ShaderNodeOutputSpecular")) { + else if (node->type == SH_NODE_EEVEE_SPECULAR && STREQ(node->idname, "ShaderNodeOutputSpecular")) { BLI_strncpy(node->idname, "ShaderNodeEeveeSpecular", sizeof(node->idname)); error = true; } + + else if (node->type == 196 /* SH_NODE_OUTPUT_EEVEE_MATERIAL */ && + STREQ(node->idname, "ShaderNodeOutputEeveeMaterial")) + { + node->type = SH_NODE_OUTPUT_MATERIAL; + BLI_strncpy(node->idname, "ShaderNodeOutputMaterial", sizeof(node->idname)); + } } } } FOREACH_NODETREE_END diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 33382af9087..b5d6104432f 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -399,7 +399,7 @@ void ED_node_shader_default(const bContext *C, ID *id) ma->nodetree = ntree; if (BKE_scene_uses_blender_eevee(scene)) { - output_type = SH_NODE_OUTPUT_EEVEE_MATERIAL; + output_type = SH_NODE_OUTPUT_MATERIAL; shader_type = SH_NODE_EEVEE_METALLIC; } else if (BKE_scene_use_new_shading_nodes(scene)) { diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index b667df16101..b8b2b6a4d56 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -4080,11 +4080,6 @@ void node_eevee_specular( result = Closure(L + emissive.rgb, 1.0 - transp, vec4(ssr_spec, roughness), normal_encode(vN, viewCameraVec), int(ssr_id)); } -void node_output_eevee_material(Closure surface, out Closure result) -{ - result = surface; -} - #endif /* EEVEE_ENGINE */ #endif /* VOLUMETRICS */ diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index 2c46791ae18..03912c95940 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -188,7 +188,6 @@ set(SRC shader/nodes/node_shader_eevee_specular.c shader/nodes/node_shader_output_lamp.c shader/nodes/node_shader_output_material.c - shader/nodes/node_shader_output_eevee_material.c shader/nodes/node_shader_output_world.c shader/nodes/node_shader_output_linestyle.c shader/nodes/node_shader_particle_info.c diff --git a/source/blender/nodes/NOD_static_types.h b/source/blender/nodes/NOD_static_types.h index d8944776cbb..490ef91f660 100644 --- a/source/blender/nodes/NOD_static_types.h +++ b/source/blender/nodes/NOD_static_types.h @@ -69,7 +69,6 @@ DefNode( ShaderNode, SH_NODE_HUE_SAT, 0, "HUE_S DefNode( ShaderNode, SH_NODE_OUTPUT_MATERIAL, def_sh_output, "OUTPUT_MATERIAL", OutputMaterial, "Material Output", "" ) DefNode( ShaderNode, SH_NODE_EEVEE_METALLIC, 0, "EEVEE_METALLIC", EeveeMetallic, "Metallic", "") DefNode( ShaderNode, SH_NODE_EEVEE_SPECULAR, 0, "EEVEE_SPECULAR", EeveeSpecular, "Specular", "") -DefNode( ShaderNode, SH_NODE_OUTPUT_EEVEE_MATERIAL, def_sh_output, "OUTPUT_EEVEE_MATERIAL", OutputEeveeMaterial, "Material Output", "") DefNode( ShaderNode, SH_NODE_OUTPUT_LAMP, def_sh_output, "OUTPUT_LAMP", OutputLamp, "Lamp Output", "" ) DefNode( ShaderNode, SH_NODE_OUTPUT_WORLD, def_sh_output, "OUTPUT_WORLD", OutputWorld, "World Output", "" ) DefNode( ShaderNode, SH_NODE_OUTPUT_LINESTYLE, def_sh_output_linestyle,"OUTPUT_LINESTYLE", OutputLineStyle, "Line Style Output", "" ) diff --git a/source/blender/nodes/shader/nodes/node_shader_output_eevee_material.c b/source/blender/nodes/shader/nodes/node_shader_output_eevee_material.c deleted file mode 100644 index faf715f2b66..00000000000 --- a/source/blender/nodes/shader/nodes/node_shader_output_eevee_material.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * ***** 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" - -#include "BKE_scene.h" - -/* **************** OUTPUT ******************** */ - -static bNodeSocketTemplate sh_node_output_eevee_material_in[] = { - { SOCK_SHADER, 1, N_("Surface")}, - { -1, 0, "" } -}; - -static int node_shader_gpu_output_eevee_material(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) -{ - GPUNodeLink *outlink; - - GPU_stack_link(mat, node, "node_output_eevee_material", in, out, &outlink); - GPU_material_output_link(mat, outlink); - - return true; -} - - -/* node type definition */ -void register_node_type_sh_output_eevee_material(void) -{ - static bNodeType ntype; - - sh_node_type_base(&ntype, SH_NODE_OUTPUT_EEVEE_MATERIAL, "Material Output", NODE_CLASS_OUTPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); - node_type_socket_templates(&ntype, sh_node_output_eevee_material_in, NULL); - node_type_init(&ntype, NULL); - node_type_storage(&ntype, "", NULL, NULL); - node_type_gpu(&ntype, node_shader_gpu_output_eevee_material); - - /* Do not allow muting output node. */ - node_type_internal_links(&ntype, NULL); - - nodeRegisterType(&ntype); -} |