diff options
author | Thomas Dinges <blender@dingto.org> | 2013-05-20 19:58:37 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2013-05-20 19:58:37 +0400 |
commit | 3758193c18a886faa5bb803dd378f24866e793e5 (patch) | |
tree | 9d013e4f7008845a3a2b04539396bb2e2e341888 /source/blender/nodes | |
parent | 38dc85f296a27a5641d296c8f41834db41dac18b (diff) |
Cycles / Wireframe node:
* Added a wireframe node (Input category) to get access to Mesh wireframe data.
The thickness can be controlled via a "Size" parameter, and is available in world units (default) and screen pixel size.
* Only the triangulated mesh is available now, quads is for later.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Wireframe
Render and Example file:
http://www.pasteall.org/pic/show.php?id=51731
http://www.pasteall.org/blend/21510
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/nodes/NOD_shader.h | 1 | ||||
-rw-r--r-- | source/blender/nodes/NOD_static_types.h | 1 | ||||
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_wireframe.c | 54 |
4 files changed, 57 insertions, 0 deletions
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index f2ce9665e2b..3e0c57f4960 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -145,6 +145,7 @@ set(SRC shader/nodes/node_shader_texture.c shader/nodes/node_shader_valToRgb.c shader/nodes/node_shader_value.c + shader/nodes/node_shader_wireframe.c shader/nodes/node_shader_vectMath.c shader/nodes/node_shader_add_shader.c shader/nodes/node_shader_ambient_occlusion.c diff --git a/source/blender/nodes/NOD_shader.h b/source/blender/nodes/NOD_shader.h index eb324182e39..334f8f48ca0 100644 --- a/source/blender/nodes/NOD_shader.h +++ b/source/blender/nodes/NOD_shader.h @@ -79,6 +79,7 @@ void register_node_type_sh_light_path(void); void register_node_type_sh_light_falloff(void); void register_node_type_sh_object_info(void); void register_node_type_sh_fresnel(void); +void register_node_type_sh_wireframe(void); void register_node_type_sh_layer_weight(void); void register_node_type_sh_tex_coord(void); void register_node_type_sh_particle_info(void); diff --git a/source/blender/nodes/NOD_static_types.h b/source/blender/nodes/NOD_static_types.h index f9868966892..2754fb1b886 100644 --- a/source/blender/nodes/NOD_static_types.h +++ b/source/blender/nodes/NOD_static_types.h @@ -94,6 +94,7 @@ DefNode( ShaderNode, SH_NODE_LIGHT_FALLOFF, 0, "LI DefNode( ShaderNode, SH_NODE_OBJECT_INFO, 0, "OBJECT_INFO", ObjectInfo, "Object Info", "" ) DefNode( ShaderNode, SH_NODE_PARTICLE_INFO, 0, "PARTICLE_INFO", ParticleInfo, "Particle Info", "" ) DefNode( ShaderNode, SH_NODE_HAIR_INFO, 0, "HAIR_INFO", HairInfo, "Hair Info", "" ) +DefNode( ShaderNode, SH_NODE_WIREFRAME, def_sh_tex_wireframe, "WIREFRAME", Wireframe, "Wireframe", "" ) DefNode( ShaderNode, SH_NODE_BUMP, def_sh_bump, "BUMP", Bump, "Bump", "" ) DefNode( ShaderNode, SH_NODE_NORMAL_MAP, def_sh_normal_map, "NORMAL_MAP", NormalMap, "Normal Map", "" ) DefNode( ShaderNode, SH_NODE_TANGENT, def_sh_tangent, "TANGENT", Tangent, "Tangent", "" ) diff --git a/source/blender/nodes/shader/nodes/node_shader_wireframe.c b/source/blender/nodes/shader/nodes/node_shader_wireframe.c new file mode 100644 index 00000000000..76a176db614 --- /dev/null +++ b/source/blender/nodes/shader/nodes/node_shader_wireframe.c @@ -0,0 +1,54 @@ +/* + * ***** 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" + +/* **************** Wireframe ******************** */ +static bNodeSocketTemplate sh_node_wireframe_in[] = { + { SOCK_FLOAT, 1, N_("Size"), 0.01f, 0.0f, 0.0f, 0.0f, 0.0f, 100.0f}, + { -1, 0, "" } +}; + +static bNodeSocketTemplate sh_node_wireframe_out[] = { + { SOCK_FLOAT, 0, N_("Fac"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; + +/* node type definition */ +void register_node_type_sh_wireframe(void) +{ + static bNodeType ntype; + + sh_node_type_base(&ntype, SH_NODE_WIREFRAME, "Wireframe", NODE_CLASS_INPUT, NODE_OPTIONS); + node_type_compatibility(&ntype, NODE_NEW_SHADING); + node_type_socket_templates(&ntype, sh_node_wireframe_in, sh_node_wireframe_out); + node_type_size(&ntype, 150, 60, 200); + node_type_init(&ntype, NULL); + node_type_storage(&ntype, "", NULL, NULL); + + nodeRegisterType(&ntype); +} |