Commit: 9622dace3e23a8eddaa0c443030120072a4a6482 Author: Brecht Van Lommel Date: Mon Jun 20 17:10:27 2022 +0200 Branches: master https://developer.blender.org/rB9622dace3e23a8eddaa0c443030120072a4a6482
Cleanup: removed unused Blender Internal bump/normal mapping texture code The TexResult.nor output does not appear to be used anywhere. =================================================================== M source/blender/blenkernel/intern/effect.c M source/blender/blenkernel/intern/fluid.c M source/blender/makesdna/DNA_texture_types.h M source/blender/modifiers/intern/MOD_displace.c M source/blender/modifiers/intern/MOD_warp.c M source/blender/modifiers/intern/MOD_wave.c M source/blender/modifiers/intern/MOD_weightvg_util.c M source/blender/nodes/texture/node_texture_tree.c M source/blender/nodes/texture/nodes/node_texture_output.c M source/blender/nodes/texture/nodes/node_texture_proc.c M source/blender/nodes/texture/nodes/node_texture_texture.c M source/blender/render/RE_texture.h M source/blender/render/intern/texture_image.c M source/blender/render/intern/texture_procedural.c =================================================================== diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index f2915a97746..7722c2fa004 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -868,8 +868,6 @@ static void do_texture_effector(EffectorCache *eff, return; } - result[0].nor = result[1].nor = result[2].nor = result[3].nor = NULL; - strength = eff->pd->f_strength * efd->falloff; copy_v3_v3(tex_co, point->loc); diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index 06d32d5bfd4..5cd5a699dec 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -1942,7 +1942,6 @@ static void sample_mesh(FluidFlowSettings *ffs, tex_co[1] = tex_co[1] * 2.0f - 1.0f; tex_co[2] = ffs->texture_offset; } - texres.nor = NULL; BKE_texture_get_value(NULL, ffs->noise_texture, tex_co, &texres, false); emission_strength *= texres.tin; } diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index b725939dbab..e32d9dbe300 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -397,8 +397,7 @@ typedef struct ColorMapping { /* return value */ #define TEX_INT 0 -#define TEX_RGB (1 << 0) -#define TEX_NOR (1 << 1) +#define TEX_RGB 1 /* pr_texture in material, world, light. */ #define TEX_PR_TEXTURE 0 diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c index 149cf0c0cbb..1e2224e3a65 100644 --- a/source/blender/modifiers/intern/MOD_displace.c +++ b/source/blender/modifiers/intern/MOD_displace.c @@ -197,7 +197,6 @@ static void displaceModifier_do_task(void *__restrict userdata, } if (data->tex_target) { - texres.nor = NULL; BKE_texture_get_value_ex( data->scene, data->tex_target, tex_co[iter], &texres, data->pool, false); delta = texres.tin - dmd->midlevel; diff --git a/source/blender/modifiers/intern/MOD_warp.c b/source/blender/modifiers/intern/MOD_warp.c index 402d7b2c99e..9693cf0c0f2 100644 --- a/source/blender/modifiers/intern/MOD_warp.c +++ b/source/blender/modifiers/intern/MOD_warp.c @@ -302,7 +302,6 @@ static void warpModifier_do(WarpModifierData *wmd, if (tex_co) { struct Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph); TexResult texres; - texres.nor = NULL; BKE_texture_get_value(scene, tex_target, tex_co[i], &texres, false); fac *= texres.tin; } diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c index 73b26dc29cd..4073f028db5 100644 --- a/source/blender/modifiers/intern/MOD_wave.c +++ b/source/blender/modifiers/intern/MOD_wave.c @@ -262,7 +262,6 @@ static void waveModifier_do(WaveModifierData *md, if (tex_co) { Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph); TexResult texres; - texres.nor = NULL; BKE_texture_get_value(scene, tex_target, tex_co[i], &texres, false); amplit *= texres.tin; } diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c index 65393370268..3302384568b 100644 --- a/source/blender/modifiers/intern/MOD_weightvg_util.c +++ b/source/blender/modifiers/intern/MOD_weightvg_util.c @@ -162,7 +162,6 @@ void weightvg_do_mask(const ModifierEvalContext *ctx, do_color_manage = tex_use_channel != MOD_WVG_MASK_TEX_USE_INT; - texres.nor = NULL; BKE_texture_get_value(scene, texture, tex_co[idx], &texres, do_color_manage); /* Get the good channel value... */ switch (tex_use_channel) { 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 @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs