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/intern/CMP_nodes/CMP_texture.c')
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_texture.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_texture.c b/source/blender/nodes/intern/CMP_nodes/CMP_texture.c
index b6335d6afe7..d344e9bf959 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_texture.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_texture.c
@@ -90,16 +90,12 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in,
/* outputs: value, color, normal */
if(node->id) {
- /* RenderData *rd= data; */
- /* short sizex, sizey; */
+ RenderData *rd= data;
+ short sizex, sizey;
/* first make the preview image */
CompBuf *prevbuf= alloc_compbuf(140, 140, CB_RGBA, 1); /* alloc */
- /* Also take care about the render size! */
- /* sizex = (rd->size*rd->xsch)/100; */
- /* sizey = (rd->size*rd->ysch)/100; */
-
prevbuf->rect_procedural= texture_procedural;
prevbuf->node= node;
VECCOPY(prevbuf->procedural_offset, in[0]->vec);
@@ -107,32 +103,39 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in,
prevbuf->procedural_type= CB_RGBA;
composit1_pixel_processor(node, prevbuf, prevbuf, out[0]->vec, do_copy_rgba, CB_RGBA);
- /* texture is procedural node, like RGBA node, we give it fake buffer for nodes that don't check it */
+ generate_preview(data, node, prevbuf);
+ free_compbuf(prevbuf);
+
+ /* texture procedural buffer type doesnt work well, we now render a buffer in scene size */
+ sizex = (rd->size*rd->xsch)/100;
+ sizey = (rd->size*rd->ysch)/100;
+
if(out[0]->hasoutput) {
- CompBuf *stackbuf= dupalloc_compbuf(prevbuf); /* buffer alloc */
+ CompBuf *stackbuf= alloc_compbuf(sizex, sizey, CB_VAL, 1); /* alloc */
stackbuf->rect_procedural= texture_procedural;
stackbuf->node= node;
VECCOPY(stackbuf->procedural_offset, in[0]->vec);
VECCOPY(stackbuf->procedural_size, in[1]->vec);
stackbuf->procedural_type= CB_VAL;
+ composit1_pixel_processor(node, prevbuf, prevbuf, out[0]->vec, do_copy_value, CB_VAL);
+ stackbuf->rect_procedural= NULL;
out[0]->data= stackbuf;
}
if(out[1]->hasoutput) {
- CompBuf *stackbuf= dupalloc_compbuf(prevbuf); /* buffer alloc */
+ CompBuf *stackbuf= alloc_compbuf(sizex, sizey, CB_RGBA, 1); /* alloc */
stackbuf->rect_procedural= texture_procedural;
stackbuf->node= node;
VECCOPY(stackbuf->procedural_offset, in[0]->vec);
VECCOPY(stackbuf->procedural_size, in[1]->vec);
stackbuf->procedural_type= CB_RGBA;
+ composit1_pixel_processor(node, prevbuf, prevbuf, out[0]->vec, do_copy_rgba, CB_RGBA);
+ stackbuf->rect_procedural= NULL;
out[1]->data= stackbuf;
}
-
- generate_preview(data, node, prevbuf);
- free_compbuf(prevbuf);
}
}