diff options
author | Julian Eisel <julian@blender.org> | 2022-11-10 15:17:42 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-11-10 15:17:42 +0300 |
commit | 7246c387435769a169ac24c91434c615df6434b4 (patch) | |
tree | 61842e3e0ce85e80720fdd7476d44d2e629f59fd /source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc | |
parent | c5f55d17096d373791363e46004176e3f7f7ae52 (diff) | |
parent | 0b4bd3ddc016298e868169a541cf6c132b10c587 (diff) |
Merge branch 'master' into asset-browser-grid-viewasset-browser-grid-view
Diffstat (limited to 'source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc index fc6a5ef72b6..f07ef1b6c60 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc @@ -15,7 +15,9 @@ NODE_STORAGE_FUNCS(NodeTexVoronoi) static void sh_node_tex_voronoi_declare(NodeDeclarationBuilder &b) { b.is_function_node(); - b.add_input<decl::Vector>(N_("Vector")).hide_value().implicit_field(); + b.add_input<decl::Vector>(N_("Vector")) + .hide_value() + .implicit_field(implicit_field_inputs::position); b.add_input<decl::Float>(N_("W")).min(-1000.0f).max(1000.0f).make_available([](bNode &node) { /* Default to 1 instead of 4, because it is much faster. */ node_storage(node).dimensions = 1; @@ -49,7 +51,7 @@ static void sh_node_tex_voronoi_declare(NodeDeclarationBuilder &b) }); } -static void node_shader_buts_tex_voronoi(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +static void node_shader_buts_tex_voronoi(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr) { uiItemR(layout, ptr, "voronoi_dimensions", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE); uiItemR(layout, ptr, "feature", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE); @@ -60,7 +62,7 @@ static void node_shader_buts_tex_voronoi(uiLayout *layout, bContext *UNUSED(C), } } -static void node_shader_init_tex_voronoi(bNodeTree *UNUSED(ntree), bNode *node) +static void node_shader_init_tex_voronoi(bNodeTree * /*ntree*/, bNode *node) { NodeTexVoronoi *tex = MEM_cnew<NodeTexVoronoi>(__func__); BKE_texture_mapping_default(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); @@ -119,7 +121,7 @@ static const char *gpu_shader_get_name(const int feature, const int dimensions) static int node_shader_gpu_tex_voronoi(GPUMaterial *mat, bNode *node, - bNodeExecData *UNUSED(execdata), + bNodeExecData * /*execdata*/, GPUNodeStack *in, GPUNodeStack *out) { @@ -173,7 +175,7 @@ static void node_shader_update_tex_voronoi(bNodeTree *ntree, bNode *node) outWSock, storage.feature != SHD_VORONOI_DISTANCE_TO_EDGE && storage.feature != SHD_VORONOI_N_SPHERE_RADIUS && - (ELEM(storage.dimensions, 1, 4))); + ELEM(storage.dimensions, 1, 4)); nodeSetSocketAvailability(ntree, outRadiusSock, storage.feature == SHD_VORONOI_N_SPHERE_RADIUS); } @@ -234,7 +236,7 @@ class VoronoiMinowskiFunction : public fn::MultiFunction { return signature.build(); } - void call(IndexMask mask, fn::MFParams params, fn::MFContext UNUSED(context)) const override + void call(IndexMask mask, fn::MFParams params, fn::MFContext /*context*/) const override { auto get_vector = [&](int param_index) -> VArray<float3> { return params.readonly_single_input<float3>(param_index, "Vector"); @@ -670,7 +672,7 @@ class VoronoiMetricFunction : public fn::MultiFunction { return signature.build(); } - void call(IndexMask mask, fn::MFParams params, fn::MFContext UNUSED(context)) const override + void call(IndexMask mask, fn::MFParams params, fn::MFContext /*context*/) const override { auto get_vector = [&](int param_index) -> VArray<float3> { return params.readonly_single_input<float3>(param_index, "Vector"); @@ -1177,7 +1179,7 @@ class VoronoiEdgeFunction : public fn::MultiFunction { return signature.build(); } - void call(IndexMask mask, fn::MFParams params, fn::MFContext UNUSED(context)) const override + void call(IndexMask mask, fn::MFParams params, fn::MFContext /*context*/) const override { auto get_vector = [&](int param_index) -> VArray<float3> { return params.readonly_single_input<float3>(param_index, "Vector"); @@ -1345,11 +1347,11 @@ void register_node_type_sh_tex_voronoi() sh_fn_node_type_base(&ntype, SH_NODE_TEX_VORONOI, "Voronoi Texture", NODE_CLASS_TEXTURE); ntype.declare = file_ns::sh_node_tex_voronoi_declare; ntype.draw_buttons = file_ns::node_shader_buts_tex_voronoi; - node_type_init(&ntype, file_ns::node_shader_init_tex_voronoi); + ntype.initfunc = file_ns::node_shader_init_tex_voronoi; node_type_storage( &ntype, "NodeTexVoronoi", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::node_shader_gpu_tex_voronoi); - node_type_update(&ntype, file_ns::node_shader_update_tex_voronoi); + ntype.gpu_fn = file_ns::node_shader_gpu_tex_voronoi; + ntype.updatefunc = file_ns::node_shader_update_tex_voronoi; ntype.build_multi_function = file_ns::sh_node_voronoi_build_multi_function; nodeRegisterType(&ntype); |