diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-05-20 19:05:29 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-05-20 19:05:29 +0300 |
commit | c6ea288bcf98ebe9c14c51b42beebc69632571f3 (patch) | |
tree | 4326d07f2fa5aa92db9fe8bdd22aa70d9ee48d61 /source/blender/nodes | |
parent | ca8419ed6efa3a764ea1f51d745bfc0ad3e64246 (diff) |
Support voronoi texture in GLSL shading
It gives some slight differences on the plane corners, but can't
really figure out source of the issue here yet.
It's still better than fully white texture for the previews anyway.
At this point we should perhaps ifdef chunks of the code in order
to have faster GLSL compilation and probably even faster compiled
code. Will look into this shortly.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c index 88596a4a72f..c994798e2da 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c @@ -53,12 +53,17 @@ static void node_shader_init_tex_voronoi(bNodeTree *UNUSED(ntree), bNode *node) static int node_shader_gpu_tex_voronoi(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) { - if (!in[0].link) + if (!in[0].link) { in[0].link = GPU_attribute(CD_ORCO, ""); + GPU_link(mat, "generated_from_orco", in[0].link, &in[0].link); + } node_shader_gpu_tex_mapping(mat, node, in, out); - return GPU_stack_link(mat, "node_tex_voronoi", in, out); + NodeTexVoronoi *tex = (NodeTexVoronoi *)node->storage; + float coloring = tex->coloring; + + return GPU_stack_link(mat, "node_tex_voronoi", in, out, GPU_uniform(&coloring)); } /* node type definition */ |