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:
Diffstat (limited to 'source/blender/nodes/shader/nodes/node_shader_tex_noise.c')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_noise.c57
1 files changed, 1 insertions, 56 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_noise.c b/source/blender/nodes/shader/nodes/node_shader_tex_noise.c
index 8cde640f8b2..6c27384a24d 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_noise.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_noise.c
@@ -28,43 +28,6 @@
*/
#include "../node_shader_util.h"
-#include "node_shader_noise.h"
-
-static float noise_texture(float scale, float detail, float distortion, float vec[3], float color[3])
-{
- float p[3], pg[3], pb[3];
- int basis= SHD_NOISE_PERLIN;
-
- mul_v3_v3fl(p, vec, scale);
-
- if(distortion != 0.0f) {
- float r[3], p_offset[3], p_noffset[3];
- float offset[3] = {13.5f, 13.5f, 13.5f};
-
- add_v3_v3v3(p_offset, p, offset);
- sub_v3_v3v3(p_noffset, p, offset);
-
- r[0] = noise_basis(p_offset, basis) * distortion;
- r[1] = noise_basis(p, basis) * distortion;
- r[2] = noise_basis(p_noffset, basis) * distortion;
-
- add_v3_v3(p, r);
- }
-
- pg[0]= p[1];
- pg[1]= p[0];
- pg[2]= p[2];
-
- pb[0]= p[1];
- pb[1]= p[2];
- pb[2]= p[0];
-
- color[0]= noise_turbulence(p, basis, detail, 0);
- color[1]= noise_turbulence(pg, basis, detail, 0);
- color[2]= noise_turbulence(pb, basis, detail, 0);
-
- return color[0];
-}
/* **************** NOISE ******************** */
@@ -91,24 +54,6 @@ static void node_shader_init_tex_noise(bNodeTree *UNUSED(ntree), bNode* node, bN
node->storage = tex;
}
-static void node_shader_exec_tex_noise(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
-{
- ShaderCallData *scd= (ShaderCallData*)data;
- bNodeSocket *vecsock = node->inputs.first;
- float vec[3], scale, detail, distortion;
-
- if(vecsock->link)
- nodestack_get_vec(vec, SOCK_VECTOR, in[0]);
- else
- copy_v3_v3(vec, scd->co);
-
- nodestack_get_vec(&scale, SOCK_FLOAT, in[1]);
- nodestack_get_vec(&detail, SOCK_FLOAT, in[2]);
- nodestack_get_vec(&distortion, SOCK_FLOAT, in[3]);
-
- out[1]->vec[0]= noise_texture(scale, detail, distortion, vec, out[0]->vec);
-}
-
static int node_shader_gpu_tex_noise(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
{
if(!in[0].link)
@@ -130,7 +75,7 @@ void register_node_type_sh_tex_noise(ListBase *lb)
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, node_shader_init_tex_noise);
node_type_storage(&ntype, "NodeTexNoise", node_free_standard_storage, node_copy_standard_storage);
- node_type_exec(&ntype, node_shader_exec_tex_noise);
+ node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_tex_noise);
nodeRegisterType(lb, &ntype);