Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Allen <roblovski@gmail.com>2009-08-18 00:30:11 +0400
committerRobin Allen <roblovski@gmail.com>2009-08-18 00:30:11 +0400
commitf9ceeeede672a634913188c775e020c23170f4e1 (patch)
tree1f1068e7d4b118dd44795bc6412b46d36230fd28 /source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c
parent9f5d25748397aad6a4347f40c7ec6c025dc93129 (diff)
Slight refactor of texture nodes.
Delegates now receive a TexParams* instead of float *coords. This gives texture nodes access to dxt, dyt, cfra as well as coords. This fixes the time node and allows nice sampling to be implemented.
Diffstat (limited to 'source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c')
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c b/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c
index 0d24652a8f6..75b88c3a460 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c
@@ -39,28 +39,32 @@ static bNodeSocketType outputs[]= {
{ -1, 0, "" }
};
-static void normalfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void normalfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
float new_coord[3];
+ float *coord = p->coord;
- float nabla = tex_input_value(in[1], coord, thread);
+ float nabla = tex_input_value(in[1], p, thread);
float val;
float nor[3];
+
+ TexParams np = *p;
+ np.coord = new_coord;
- val = tex_input_value(in[0], coord, thread);
+ val = tex_input_value(in[0], p, thread);
new_coord[0] = coord[0] + nabla;
new_coord[1] = coord[1];
new_coord[2] = coord[2];
- nor[0] = tex_input_value(in[0], new_coord, thread);
+ nor[0] = tex_input_value(in[0], &np, thread);
new_coord[0] = coord[0];
new_coord[1] = coord[1] + nabla;
- nor[1] = tex_input_value(in[0], new_coord, thread);
+ nor[1] = tex_input_value(in[0], &np, thread);
new_coord[1] = coord[1];
new_coord[2] = coord[2] + nabla;
- nor[2] = tex_input_value(in[0], new_coord, thread);
+ nor[2] = tex_input_value(in[0], &np, thread);
out[0] = val-nor[0];
out[1] = val-nor[1];