diff options
author | Ton Roosendaal <ton@blender.org> | 2005-01-21 15:46:59 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-01-21 15:46:59 +0300 |
commit | 1f394a8e0c98c3df32456a072e6568663d92b89a (patch) | |
tree | af65d5aa4e9cb5769ce7422696c696a751e2102f /source/blender | |
parent | 8c271d7acb3b1af5679dac532f01a44cc61d02c8 (diff) |
Bug fix 2116
Area lights with "Noise" dithering only worked for first area light, the
other ones then used wrong table... bug since area lights are in blender.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/render/extern/include/render_types.h | 1 | ||||
-rw-r--r-- | source/blender/render/intern/source/ray.c | 12 |
2 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/render/extern/include/render_types.h b/source/blender/render/extern/include/render_types.h index 7c7499740cc..1042a52bf18 100644 --- a/source/blender/render/extern/include/render_types.h +++ b/source/blender/render/extern/include/render_types.h @@ -278,6 +278,7 @@ typedef struct LampRen float bias; short ray_samp, ray_sampy, ray_sampz, ray_samp_type, area_shape, ray_totsamp; + short xold, yold; /* last jitter table for area lights */ float area_size, area_sizey, area_sizez; struct ShadBuf *shb; diff --git a/source/blender/render/intern/source/ray.c b/source/blender/render/intern/source/ray.c index e1731d2dbb8..433da92e7a7 100644 --- a/source/blender/render/intern/source/ray.c +++ b/source/blender/render/intern/source/ray.c @@ -1647,20 +1647,16 @@ static float *jitter_plane(LampRen *lar, int xs, int ys) if(lar->ray_samp_type & LA_SAMP_JITTER) { /* made it threadsafe */ if(ys & 1) { - static int xold=0, yold=0; - - if(xold!=xs || yold!=ys) { + if(lar->xold!=xs || lar->yold!=ys) { jitter_plane_offset(lar->jitter, lar->jitter+2*tot, tot, lar->area_size, lar->area_sizey, BLI_frand(), BLI_frand()); - xold= xs; yold= ys; + lar->xold= xs; lar->yold= ys; } return lar->jitter+2*tot; } else { - static int xold=0, yold=0; - - if(xold!=xs || yold!=ys) { + if(lar->xold!=xs || lar->yold!=ys) { jitter_plane_offset(lar->jitter, lar->jitter+4*tot, tot, lar->area_size, lar->area_sizey, BLI_frand(), BLI_frand()); - xold= xs; yold= ys; + lar->xold= xs; lar->yold= ys; } return lar->jitter+4*tot; } |