Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c
| Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | static int node_shader_gpu_bsdf_anisotropic(GPUMaterial *mat, | ||||
| if (!in[4].link) { | if (!in[4].link) { | ||||
| GPU_link(mat, "world_normals_get", &in[4].link); | GPU_link(mat, "world_normals_get", &in[4].link); | ||||
| } | } | ||||
| GPU_material_flag_set(mat, GPU_MATFLAG_GLOSSY); | GPU_material_flag_set(mat, GPU_MATFLAG_GLOSSY); | ||||
| float use_multi_scatter = (node->custom1 == SHD_GLOSSY_MULTI_GGX) ? 1.0f : 0.0f; | float use_multi_scatter = (node->custom1 == SHD_GLOSSY_MULTI_GGX) ? 1.0f : 0.0f; | ||||
| return GPU_stack_link( | return GPU_stack_link(mat, | ||||
| mat, node, "node_bsdf_anisotropic", in, out, GPU_constant(&use_multi_scatter)); | node, | ||||
| "node_bsdf_anisotropic", | |||||
| in, | |||||
| out, | |||||
| GPU_constant(&use_multi_scatter), | |||||
| GPU_constant(&node->ssr_id)); | |||||
| } | } | ||||
| /* node type definition */ | /* node type definition */ | ||||
| void register_node_type_sh_bsdf_anisotropic(void) | void register_node_type_sh_bsdf_anisotropic(void) | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_BSDF_ANISOTROPIC, "Anisotropic BSDF", NODE_CLASS_SHADER, 0); | sh_node_type_base(&ntype, SH_NODE_BSDF_ANISOTROPIC, "Anisotropic BSDF", NODE_CLASS_SHADER, 0); | ||||
| node_type_socket_templates(&ntype, sh_node_bsdf_anisotropic_in, sh_node_bsdf_anisotropic_out); | 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_size_preset(&ntype, NODE_SIZE_MIDDLE); | ||||
| node_type_init(&ntype, node_shader_init_anisotropic); | node_type_init(&ntype, node_shader_init_anisotropic); | ||||
| node_type_storage(&ntype, "", NULL, NULL); | node_type_storage(&ntype, "", NULL, NULL); | ||||
| node_type_gpu(&ntype, node_shader_gpu_bsdf_anisotropic); | node_type_gpu(&ntype, node_shader_gpu_bsdf_anisotropic); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||