36
36
#include "RE_shader_ext.h"
38
static bNodeSocketTemplate inputs[]= {
39
{ SOCK_RGBA, 1, "Color1", 1.0f, 1.0f, 1.0f, 1.0f },
40
{ SOCK_RGBA, 1, "Color2", 0.0f, 0.0f, 0.0f, 1.0f },
38
static bNodeSocketTemplate inputs[] = {
39
{ SOCK_RGBA, 1, N_("Color1"), 1.0f, 1.0f, 1.0f, 1.0f },
40
{ SOCK_RGBA, 1, N_("Color2"), 0.0f, 0.0f, 0.0f, 1.0f },
44
static bNodeSocketTemplate outputs[]= {
45
{ SOCK_RGBA, 0, "Color" },
44
static bNodeSocketTemplate outputs[] = {
45
{ SOCK_RGBA, 0, N_("Color") },
49
49
static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
51
51
Tex *nodetex = (Tex *)node->id;
52
static float red[] = {1,0,0,1};
53
static float white[] = {1,1,1,1};
52
static float red[] = {1, 0, 0, 1};
53
static float white[] = {1, 1, 1, 1};
54
54
float co[3], dxt[3], dyt[3];
56
56
copy_v3_v3(co, p->co);
66
66
if (node->custom2 || node->need_exec==0) {
67
67
/* this node refers to its own texture tree! */
68
copy_v4_v4(out, (fabs(co[0] - co[1]) < .01) ? white : red );
68
copy_v4_v4(out, (fabsf(co[0] - co[1]) < 0.01f) ? white : red);
70
70
else if (nodetex) {
73
float nor[] = {0,0,0};
73
float nor[] = {0, 0, 0};
74
74
float col1[4], col2[4];
76
76
tex_input_rgba(col1, in[0], p, thread);
80
80
textype = multitex_nodes(nodetex, co, dxt, dyt, p->osatex,
81
&texres, thread, 0, p->shi, p->mtex);
81
&texres, thread, 0, p->shi, p->mtex, NULL);
83
83
if (textype & TEX_RGB) {
84
84
copy_v4_v4(out, &texres.tr);