diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-06-20 18:10:27 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-06-21 17:00:56 +0300 |
commit | 9622dace3e23a8eddaa0c443030120072a4a6482 (patch) | |
tree | d68ebdcb5126ad904943943b9ec7d08d42822e1b /source/blender/nodes/texture | |
parent | d90b320444d5addf6dc5473dc0b94c975a2f9479 (diff) |
Cleanup: removed unused Blender Internal bump/normal mapping texture code
The TexResult.nor output does not appear to be used anywhere.
Diffstat (limited to 'source/blender/nodes/texture')
4 files changed, 7 insertions, 59 deletions
diff --git a/source/blender/nodes/texture/node_texture_tree.c b/source/blender/nodes/texture/node_texture_tree.c index 903e293a962..03dc61af9a2 100644 --- a/source/blender/nodes/texture/node_texture_tree.c +++ b/source/blender/nodes/texture/node_texture_tree.c @@ -324,7 +324,6 @@ int ntreeTexExecTree(bNodeTree *ntree, MTex *mtex) { TexCallData data; - float *nor = target->nor; int retval = TEX_INT; bNodeThreadStack *nts = NULL; bNodeTreeExec *exec = ntree->execdata; @@ -356,14 +355,7 @@ int ntreeTexExecTree(bNodeTree *ntree, ntreeExecThreadNodes(exec, nts, &data, thread); ntreeReleaseThreadStack(nts); - if (target->nor) { - retval |= TEX_NOR; - } retval |= TEX_RGB; - /* confusing stuff; the texture output node sets this to NULL to indicate no normal socket was - * set however, the texture code checks this for other reasons - * (namely, a normal is required for material). */ - target->nor = nor; return retval; } diff --git a/source/blender/nodes/texture/nodes/node_texture_output.c b/source/blender/nodes/texture/nodes/node_texture_output.c index cf5e32cb486..b300ba9ef77 100644 --- a/source/blender/nodes/texture/nodes/node_texture_output.c +++ b/source/blender/nodes/texture/nodes/node_texture_output.c @@ -13,7 +13,6 @@ /* **************** COMPOSITE ******************** */ static bNodeSocketTemplate inputs[] = { {SOCK_RGBA, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, - {SOCK_VECTOR, N_("Normal"), 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, PROP_DIRECTION}, {-1, ""}, }; @@ -32,12 +31,7 @@ static void exec(void *data, TexParams params; params_from_cdata(¶ms, cdata); - if (in[1] && in[1]->hasinput && !in[0]->hasinput) { - tex_input_rgba(target->trgba, in[1], ¶ms, cdata->thread); - } - else { - tex_input_rgba(target->trgba, in[0], ¶ms, cdata->thread); - } + tex_input_rgba(target->trgba, in[0], ¶ms, cdata->thread); } else { /* 0 means don't care, so just use first */ @@ -49,15 +43,6 @@ static void exec(void *data, target->tin = (target->trgba[0] + target->trgba[1] + target->trgba[2]) / 3.0f; target->talpha = true; - - if (target->nor) { - if (in[1] && in[1]->hasinput) { - tex_input_vec(target->nor, in[1], ¶ms, cdata->thread); - } - else { - target->nor = NULL; - } - } } } } diff --git a/source/blender/nodes/texture/nodes/node_texture_proc.c b/source/blender/nodes/texture/nodes/node_texture_proc.c index fd7e6fdfc7f..d925c9f3554 100644 --- a/source/blender/nodes/texture/nodes/node_texture_proc.c +++ b/source/blender/nodes/texture/nodes/node_texture_proc.c @@ -14,10 +14,8 @@ * In this file: wrappers to use procedural textures as nodes */ -static bNodeSocketTemplate outputs_both[] = { - {SOCK_RGBA, N_("Color"), 1.0f, 0.0f, 0.0f, 1.0f}, - {SOCK_VECTOR, N_("Normal"), 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, PROP_DIRECTION}, - {-1, ""}}; +static bNodeSocketTemplate outputs_both[] = {{SOCK_RGBA, N_("Color"), 1.0f, 0.0f, 0.0f, 1.0f}, + {-1, ""}}; static bNodeSocketTemplate outputs_color_only[] = {{SOCK_RGBA, N_("Color")}, {-1, ""}}; /* Inputs common to all, #defined because nodes will need their own inputs too */ @@ -34,27 +32,15 @@ static void do_proc(float *result, TexParams *p, const float col1[4], const float col2[4], - char is_normal, Tex *tex, const short thread) { TexResult texres; int textype; - if (is_normal) { - texres.nor = result; - } - else { - texres.nor = NULL; - } - textype = multitex_nodes( tex, p->co, p->dxt, p->dyt, p->osatex, &texres, thread, 0, p->mtex, NULL); - if (is_normal) { - return; - } - if (textype & TEX_RGB) { copy_v4_v4(result, texres.trgba); } @@ -66,13 +52,8 @@ static void do_proc(float *result, typedef void (*MapFn)(Tex *tex, bNodeStack **in, TexParams *p, const short thread); -static void texfn(float *result, - TexParams *p, - bNode *node, - bNodeStack **in, - char is_normal, - MapFn map_inputs, - short thread) +static void texfn( + float *result, TexParams *p, bNode *node, bNodeStack **in, MapFn map_inputs, short thread) { Tex tex = *((Tex *)(node->storage)); float col1[4], col2[4]; @@ -81,7 +62,7 @@ static void texfn(float *result, map_inputs(&tex, in, p, thread); - do_proc(result, p, col1, col2, is_normal, &tex, thread); + do_proc(result, p, col1, col2, &tex, thread); } static int count_outputs(bNode *node) @@ -106,12 +87,7 @@ static int count_outputs(bNode *node) static void name##_colorfn( \ float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \ { \ - texfn(result, p, node, in, 0, &name##_map_inputs, thread); \ - } \ - static void name##_normalfn( \ - float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \ - { \ - texfn(result, p, node, in, 1, &name##_map_inputs, thread); \ + texfn(result, p, node, in, &name##_map_inputs, thread); \ } \ static void name##_exec(void *data, \ int UNUSED(thread), \ @@ -124,9 +100,6 @@ static int count_outputs(bNode *node) if (outs >= 1) { \ tex_output(node, execdata, in, out[0], &name##_colorfn, data); \ } \ - if (outs >= 2) { \ - tex_output(node, execdata, in, out[1], &name##_normalfn, data); \ - } \ } /* --- VORONOI -- */ diff --git a/source/blender/nodes/texture/nodes/node_texture_texture.c b/source/blender/nodes/texture/nodes/node_texture_texture.c index 2d2b4e06665..79cd8bbb1df 100644 --- a/source/blender/nodes/texture/nodes/node_texture_texture.c +++ b/source/blender/nodes/texture/nodes/node_texture_texture.c @@ -45,13 +45,11 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor else if (nodetex) { TexResult texres; int textype; - float nor[] = {0, 0, 0}; float col1[4], col2[4]; tex_input_rgba(col1, in[0], p, thread); tex_input_rgba(col2, in[1], p, thread); - texres.nor = nor; textype = multitex_nodes(nodetex, co, dxt, dyt, p->osatex, &texres, thread, 0, p->mtex, NULL); if (textype & TEX_RGB) { |