diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-07-21 18:13:48 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-07-21 18:13:48 +0400 |
commit | ff00aa1b7ea71c44177762a72c23835af16073d2 (patch) | |
tree | 1d72b4bbc93123c4345636917710503dd9021bf0 /source/blender/nodes/intern | |
parent | ee6be64a2c0a8c0b04d71ec19fce239e519932e1 (diff) |
Fix #22786: displace node doesn't work with procedural textures.
Diffstat (limited to 'source/blender/nodes/intern')
-rw-r--r-- | source/blender/nodes/intern/CMP_util.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/nodes/intern/CMP_util.c b/source/blender/nodes/intern/CMP_util.c index f3e00cb37f8..bcb038bccc3 100644 --- a/source/blender/nodes/intern/CMP_util.c +++ b/source/blender/nodes/intern/CMP_util.c @@ -1125,7 +1125,19 @@ void convolve(CompBuf* dst, CompBuf* in1, CompBuf* in2) // sets fcol to pixelcolor at (x, y) void qd_getPixel(CompBuf* src, int x, int y, float* col) { - if ((x >= 0) && (x < src->x) && (y >= 0) && (y < src->y)) { + if(src->rect_procedural) { + float bc[4]; + src->rect_procedural(src, bc, (float)x/(float)src->xrad, (float)y/(float)src->yrad); + + switch(src->type){ + /* these fallthrough to get all the channels */ + case CB_RGBA: col[3]=bc[3]; + case CB_VEC3: col[2]=bc[2]; + case CB_VEC2: col[1]=bc[1]; + case CB_VAL: col[0]=bc[0]; + } + } + else if ((x >= 0) && (x < src->x) && (y >= 0) && (y < src->y)) { float* bc = &src->rect[(x + y*src->x)*src->type]; switch(src->type){ /* these fallthrough to get all the channels */ |