void register_node_type_sh_group(void)
{
	static bNodeType ntype;
	
	/* NB: cannot use sh_node_type_base for node group, because it would map the node type
	 * to the shared NODE_GROUP integer type id.
	 */
	node_type_base_custom(&ntype, "ShaderNodeGroup", "Group", NODE_CLASS_GROUP, NODE_CONST_OUTPUT);
	ntype.type = NODE_GROUP;
	ntype.poll = sh_node_poll_default;
	ntype.poll_instance = node_group_poll_instance;
	ntype.update_internal_links = node_update_internal_links_default;
	ntype.ext.srna = RNA_struct_find("ShaderNodeGroup");
	BLI_assert(ntype.ext.srna != NULL);
	RNA_struct_blender_type_set(ntype.ext.srna, &ntype);
	
	node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING);
	node_type_socket_templates(&ntype, NULL, NULL);
	node_type_size(&ntype, 140, 60, 400);
	node_type_label(&ntype, node_group_label);
	node_type_update(&ntype, NULL, node_group_verify);
	node_type_exec(&ntype, group_initexec, group_freeexec, group_execute);
	node_type_gpu(&ntype, gpu_group_execute);
	
	nodeRegisterType(&ntype);
}
Esempio n. 2
0
void register_node_type_sh_value(void)
{
	static bNodeType ntype;

	sh_node_type_base(&ntype, SH_NODE_VALUE, "Value", NODE_CLASS_INPUT, 0);
	node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING);
	node_type_socket_templates(&ntype, NULL, sh_node_value_out);
	node_type_gpu(&ntype, gpu_shader_value);

	nodeRegisterType(&ntype);
}
Esempio n. 3
0
void register_node_type_sh_seprgb(void)
{
  static bNodeType ntype;

  sh_node_type_base(&ntype, SH_NODE_SEPRGB, "Separate RGB", NODE_CLASS_CONVERTOR, 0);
  node_type_socket_templates(&ntype, sh_node_seprgb_in, sh_node_seprgb_out);
  node_type_exec(&ntype, NULL, NULL, node_shader_exec_seprgb);
  node_type_gpu(&ntype, gpu_shader_seprgb);

  nodeRegisterType(&ntype);
}
/* node type definition */
void register_node_type_sh_ambient_occlusion(void)
{
  static bNodeType ntype;

  sh_node_type_base(&ntype, SH_NODE_AMBIENT_OCCLUSION, "Ambient Occlusion", NODE_CLASS_INPUT, 0);
  node_type_socket_templates(&ntype, sh_node_ambient_occlusion_in, sh_node_ambient_occlusion_out);
  node_type_init(&ntype, node_shader_init_ambient_occlusion);
  node_type_storage(&ntype, "", NULL, NULL);
  node_type_gpu(&ntype, node_shader_gpu_ambient_occlusion);

  nodeRegisterType(&ntype);
}
/* node type definition */
void register_node_type_sh_volume_scatter(void)
{
  static bNodeType ntype;

  sh_node_type_base(&ntype, SH_NODE_VOLUME_SCATTER, "Volume Scatter", NODE_CLASS_SHADER, 0);
  node_type_socket_templates(&ntype, sh_node_volume_scatter_in, sh_node_volume_scatter_out);
  node_type_init(&ntype, NULL);
  node_type_storage(&ntype, "", NULL, NULL);
  node_type_gpu(&ntype, node_shader_gpu_volume_scatter);

  nodeRegisterType(&ntype);
}
Esempio n. 6
0
/* node type definition */
void register_node_type_sh_hair_info(void)
{
  static bNodeType ntype;

  sh_node_type_base(&ntype, SH_NODE_HAIR_INFO, "Hair Info", NODE_CLASS_INPUT, 0);
  node_type_socket_templates(&ntype, NULL, outputs);
  node_type_init(&ntype, NULL);
  node_type_storage(&ntype, "", NULL, NULL);
  node_type_gpu(&ntype, node_shader_gpu_hair_info);

  nodeRegisterType(&ntype);
}
Esempio n. 7
0
/* node type definition */
void register_node_type_sh_bump(void)
{
	static bNodeType ntype;

	sh_node_type_base(&ntype, SH_NODE_BUMP, "Bump", NODE_CLASS_OP_VECTOR, 0);
	node_type_compatibility(&ntype, NODE_NEW_SHADING);
	node_type_socket_templates(&ntype, sh_node_bump_in, sh_node_bump_out);
	node_type_storage(&ntype, "BumpNode", node_free_standard_storage, node_copy_standard_storage);
	node_type_gpu(&ntype, gpu_shader_bump);

	nodeRegisterType(&ntype);
}
Esempio n. 8
0
void register_node_type_sh_hue_sat(ListBase *lb)
{
	static bNodeType ntype;

	node_type_base(&ntype, SH_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR, NODE_OPTIONS,
		sh_node_hue_sat_in, sh_node_hue_sat_out);
	node_type_size(&ntype, 150, 80, 250);
	node_type_exec(&ntype, node_shader_exec_hue_sat);
	node_type_gpu(&ntype, gpu_shader_hue_sat);

	nodeRegisterType(lb, &ntype);
}
void register_node_type_sh_texture(void)
{
	static bNodeType ntype;

	sh_node_type_base(&ntype, SH_NODE_TEXTURE, "Texture", NODE_CLASS_INPUT, NODE_PREVIEW);
	node_type_compatibility(&ntype, NODE_OLD_SHADING);
	node_type_socket_templates(&ntype, sh_node_texture_in, sh_node_texture_out);
	node_type_exec(&ntype, NULL, NULL, node_shader_exec_texture);
	node_type_gpu(&ntype, gpu_shader_texture);

	nodeRegisterType(&ntype);
}
Esempio n. 10
0
void register_node_type_sh_value(ListBase *lb)
{
	static bNodeType ntype;

	node_type_base(&ntype, SH_NODE_VALUE, "Value", NODE_CLASS_INPUT, NODE_OPTIONS,
		NULL, sh_node_value_out);
	node_type_size(&ntype, 80, 50, 120);
	node_type_exec(&ntype, node_shader_exec_value);
	node_type_gpu(&ntype, gpu_shader_value);

	nodeRegisterType(lb, &ntype);
}
Esempio n. 11
0
void register_node_type_sh_normal(void)
{
	static bNodeType ntype;
	
	sh_node_type_base(&ntype, SH_NODE_NORMAL, "Normal", NODE_CLASS_OP_VECTOR, 0);
	node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING);
	node_type_socket_templates(&ntype, sh_node_normal_in, sh_node_normal_out);
	node_type_exec(&ntype, NULL, NULL, node_shader_exec_normal);
	node_type_gpu(&ntype, gpu_shader_normal);
	
	nodeRegisterType(&ntype);
}
Esempio n. 12
0
void register_node_type_sh_combrgb(ListBase *lb)
{
    static bNodeType ntype;

    node_type_base(&ntype, SH_NODE_COMBRGB, "Combine RGB", NODE_CLASS_CONVERTOR, NODE_OPTIONS,
                   sh_node_combrgb_in, sh_node_combrgb_out);
    node_type_size(&ntype, 80, 40, 140);
    node_type_exec(&ntype, node_shader_exec_combrgb);
    node_type_gpu(&ntype, gpu_shader_combrgb);

    nodeRegisterType(lb, &ntype);
}
Esempio n. 13
0
void register_node_type_sh_seprgb(ListBase *lb)
{
    static bNodeType ntype;

    node_type_base(&ntype, SH_NODE_SEPRGB, "Separate RGB", NODE_CLASS_CONVERTOR, 0,
                   sh_node_seprgb_in, sh_node_seprgb_out);
    node_type_size(&ntype, 80, 40, 140);
    node_type_exec(&ntype, node_shader_exec_seprgb);
    node_type_gpu(&ntype, gpu_shader_seprgb);

    nodeRegisterType(lb, &ntype);
}
Esempio n. 14
0
void register_node_type_sh_rgbtobw(void)
{
	static bNodeType ntype;

	sh_node_type_base(&ntype, SH_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTOR, 0);
	node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING);
	node_type_socket_templates(&ntype, sh_node_rgbtobw_in, sh_node_rgbtobw_out);
	node_type_exec(&ntype, NULL, NULL, node_shader_exec_rgbtobw);
	node_type_gpu(&ntype, gpu_shader_rgbtobw);

	nodeRegisterType(&ntype);
}
/* node type definition */
void register_node_type_sh_particle_info(void)
{
	static bNodeType ntype;

	sh_node_type_base(&ntype, SH_NODE_PARTICLE_INFO, "Particle Info", NODE_CLASS_INPUT, 0);
	node_type_compatibility(&ntype, NODE_NEW_SHADING | NODE_OLD_SHADING);
	node_type_socket_templates(&ntype, NULL, outputs);
	node_type_exec(&ntype, NULL, NULL, node_shader_exec_particle_info);
	node_type_gpu(&ntype, gpu_shader_particle_info);

	nodeRegisterType(&ntype);
}
Esempio n. 16
0
void register_node_type_sh_rgbtobw(ListBase *lb)
{
	static bNodeType ntype;

	node_type_base(&ntype, SH_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTOR, 0,
		sh_node_rgbtobw_in, sh_node_rgbtobw_out);
	node_type_size(&ntype, 80, 40, 120);
	node_type_exec(&ntype, node_shader_exec_rgbtobw);
	node_type_gpu(&ntype, gpu_shader_rgbtobw);

	nodeRegisterType(lb, &ntype);
}
Esempio n. 17
0
void register_node_type_sh_normal(ListBase *lb)
{
	static bNodeType ntype;
	
	node_type_base(&ntype, SH_NODE_NORMAL, "Normal", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
	node_type_socket_templates(&ntype, sh_node_normal_in, sh_node_normal_out);
	node_type_init(&ntype, node_shader_init_normal);
	node_type_exec(&ntype, node_shader_exec_normal);
	node_type_gpu(&ntype, gpu_shader_normal);
	
	nodeRegisterType(lb, &ntype);
}
Esempio n. 18
0
void register_node_type_sh_texture(ListBase *lb)
{
	static bNodeType ntype;

	node_type_base(&ntype, SH_NODE_TEXTURE, "Texture", NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW);
	node_type_socket_templates(&ntype, sh_node_texture_in, sh_node_texture_out);
	node_type_size(&ntype, 120, 80, 240);
	node_type_exec(&ntype, node_shader_exec_texture);
	node_type_gpu(&ntype, gpu_shader_texture);

	nodeRegisterType(lb, &ntype);
}
Esempio n. 19
0
void register_node_type_sh_mix_rgb(ListBase *lb)
{
	static bNodeType ntype;

	node_type_base(&ntype, SH_NODE_MIX_RGB, "Mix", NODE_CLASS_OP_COLOR, NODE_OPTIONS,
		sh_node_mix_rgb_in, sh_node_mix_rgb_out);
	node_type_size(&ntype, 100, 60, 150);
	node_type_label(&ntype, node_blend_label);
	node_type_exec(&ntype, node_shader_exec_mix_rgb);
	node_type_gpu(&ntype, gpu_shader_mix_rgb);

	nodeRegisterType(lb, &ntype);
}
Esempio n. 20
0
void register_node_type_sh_normal(bNodeTreeType *ttype)
{
	static bNodeType ntype;
	
	node_type_base(ttype, &ntype, SH_NODE_NORMAL, "Normal", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
	node_type_compatibility(&ntype, NODE_OLD_SHADING);
	node_type_socket_templates(&ntype, sh_node_normal_in, sh_node_normal_out);
	node_type_init(&ntype, node_shader_init_normal);
	node_type_exec(&ntype, node_shader_exec_normal);
	node_type_gpu(&ntype, gpu_shader_normal);
	
	nodeRegisterType(ttype, &ntype);
}
Esempio n. 21
0
/* node type definition */
void register_node_type_sh_fresnel(void)
{
	static bNodeType ntype;

	sh_node_type_base(&ntype, SH_NODE_FRESNEL, "Fresnel", NODE_CLASS_INPUT, 0);
	node_type_compatibility(&ntype, NODE_NEW_SHADING);
	node_type_socket_templates(&ntype, sh_node_fresnel_in, sh_node_fresnel_out);
	node_type_init(&ntype, NULL);
	node_type_storage(&ntype, "", NULL, NULL);
	node_type_gpu(&ntype, node_shader_gpu_fresnel);

	nodeRegisterType(&ntype);
}
void register_node_type_sh_squeeze(void)
{
	static bNodeType ntype;

	sh_node_type_base(&ntype, SH_NODE_SQUEEZE, "Squeeze Value", NODE_CLASS_CONVERTOR, 0);
	node_type_compatibility(&ntype, NODE_OLD_SHADING);
	node_type_socket_templates(&ntype, sh_node_squeeze_in, sh_node_squeeze_out);
	node_type_storage(&ntype, "", NULL, NULL);
	node_type_exec(&ntype, NULL, NULL, node_shader_exec_squeeze);
	node_type_gpu(&ntype, gpu_shader_squeeze);

	nodeRegisterType(&ntype);
}
/* node type definition */
void register_node_type_sh_tex_voronoi(void)
{
	static bNodeType ntype;

	sh_node_type_base(&ntype, SH_NODE_TEX_VORONOI, "Voronoi Texture", NODE_CLASS_TEXTURE, 0);
	node_type_compatibility(&ntype, NODE_NEW_SHADING);
	node_type_socket_templates(&ntype, sh_node_tex_voronoi_in, sh_node_tex_voronoi_out);
	node_type_init(&ntype, node_shader_init_tex_voronoi);
	node_type_storage(&ntype, "NodeTexVoronoi", node_free_standard_storage, node_copy_standard_storage);
	node_type_gpu(&ntype, node_shader_gpu_tex_voronoi);

	nodeRegisterType(&ntype);
}
/* node type definition */
void register_node_type_sh_layer_weight(void)
{
	static bNodeType ntype;

	sh_node_type_base(&ntype, SH_NODE_LAYER_WEIGHT, "Layer Weight", NODE_CLASS_INPUT, 0);
	node_type_compatibility(&ntype, NODE_NEW_SHADING);
	node_type_socket_templates(&ntype, sh_node_layer_weight_in, sh_node_layer_weight_out);
	node_type_init(&ntype, NULL);
	node_type_storage(&ntype, "", NULL, NULL);
	node_type_gpu(&ntype, node_shader_gpu_layer_weight);

	nodeRegisterType(&ntype);
}
/* node type definition */
void register_node_type_sh_tex_checker(void)
{
	static bNodeType ntype;

	sh_node_type_base(&ntype, SH_NODE_TEX_CHECKER, "Checker Texture", NODE_CLASS_TEXTURE, 0);
	node_type_compatibility(&ntype, NODE_NEW_SHADING);
	node_type_socket_templates(&ntype, sh_node_tex_checker_in, sh_node_tex_checker_out);
	node_type_init(&ntype, node_shader_init_tex_checker);
	node_type_storage(&ntype, "NodeTexChecker", node_free_standard_storage, node_copy_standard_storage);
	node_type_gpu(&ntype, node_shader_gpu_tex_checker);

	nodeRegisterType(&ntype);
}
Esempio n. 26
0
/* node type definition */
void register_node_type_sh_tex_coord(void)
{
	static bNodeType ntype;

	sh_node_type_base(&ntype, SH_NODE_TEX_COORD, "Texture Coordinate", NODE_CLASS_INPUT, 0);
	node_type_compatibility(&ntype, NODE_NEW_SHADING);
	node_type_socket_templates(&ntype, NULL, sh_node_tex_coord_out);
	node_type_init(&ntype, NULL);
	node_type_storage(&ntype, "", NULL, NULL);
	node_type_gpu(&ntype, node_shader_gpu_tex_coord);

	nodeRegisterType(&ntype);
}
Esempio n. 27
0
/* node type definition */
void register_node_type_sh_bsdf_glass(void)
{
  static bNodeType ntype;

  sh_node_type_base(&ntype, SH_NODE_BSDF_GLASS, "Glass BSDF", NODE_CLASS_SHADER, 0);
  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, node_shader_init_glass);
  node_type_storage(&ntype, "", NULL, NULL);
  node_type_gpu(&ntype, node_shader_gpu_bsdf_glass);

  nodeRegisterType(&ntype);
}
Esempio n. 28
0
/* node type definition */
void register_node_type_sh_bsdf_hair(void)
{
  static bNodeType ntype;

  sh_node_type_base(&ntype, SH_NODE_BSDF_HAIR, "Hair BSDF", NODE_CLASS_SHADER, 0);
  node_type_socket_templates(&ntype, sh_node_bsdf_hair_in, sh_node_bsdf_hair_out);
  node_type_size(&ntype, 150, 60, 200);
  node_type_init(&ntype, NULL);
  node_type_storage(&ntype, "", NULL, NULL);
  node_type_gpu(&ntype, node_shader_gpu_bsdf_hair);

  nodeRegisterType(&ntype);
}
/* node type definition */
void register_node_type_sh_bsdf_translucent(void)
{
	static bNodeType ntype;

	sh_node_type_base(&ntype, SH_NODE_BSDF_TRANSLUCENT, "Translucent BSDF", NODE_CLASS_SHADER, 0);
	node_type_compatibility(&ntype, NODE_NEW_SHADING);
	node_type_socket_templates(&ntype, sh_node_bsdf_translucent_in, sh_node_bsdf_translucent_out);
	node_type_init(&ntype, NULL);
	node_type_storage(&ntype, "", NULL, NULL);
	node_type_gpu(&ntype, node_shader_gpu_bsdf_translucent);

	nodeRegisterType(&ntype);
}
/* node type definition */
void register_node_type_sh_light_path(void)
{
	static bNodeType ntype;

	sh_node_type_base(&ntype, SH_NODE_LIGHT_PATH, "Light Path", NODE_CLASS_INPUT, 0);
	node_type_compatibility(&ntype, NODE_NEW_SHADING);
	node_type_socket_templates(&ntype, NULL, sh_node_light_path_out);
	node_type_init(&ntype, NULL);
	node_type_storage(&ntype, "", NULL, NULL);
	node_type_gpu(&ntype, node_shader_gpu_light_path);

	nodeRegisterType(&ntype);
}