diff options
author | Matt Ebb <matt@mke3.net> | 2007-10-23 07:13:34 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2007-10-23 07:13:34 +0400 |
commit | 00237a08e7c7356f0a8d8b740f27d4cca72f98bc (patch) | |
tree | 698e5720900502cef9b7735a7c0c7627b180d9a6 /source/blender/render/intern | |
parent | c1b9b32b8bab630ab04ec420a31d389b0fb09aec (diff) |
* Fix for bug #7633: SSS makes QMC crash
This occurred when using qmc shadows, full OSA, and sss - it was
assuming full OSA was being used, even when (during the SSS prepass)
osa is set to 0.
Fixed by tightening up the checks for full OSA.
Diffstat (limited to 'source/blender/render/intern')
-rw-r--r-- | source/blender/render/intern/source/rayshade.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 36b65717599..560d2151e42 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -1662,7 +1662,7 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, float *lampco, float * float adapt_thresh = lar->adapt_thresh; int max_samples = lar->ray_totsamp; float pos[3]; - int do_soft=1; + int do_soft=1, full_osa=0; colsq[0] = colsq[1] = colsq[2] = 0.0; if(isec->mode==RE_RAY_SHADOW_TRA) { @@ -1671,8 +1671,9 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, float *lampco, float * shadfac[3]= 1.0f; if (lar->ray_totsamp < 2) do_soft = 0; - - if (shi->vlr->flag & R_FULL_OSA) { + if ((R.r.mode & R_OSA) && (R.osa > 0) && (shi->vlr->flag & R_FULL_OSA)) full_osa = 1; + + if (full_osa) { if (do_soft) max_samples = max_samples/R.osa + 1; else max_samples = 1; } else { @@ -1702,7 +1703,7 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, float *lampco, float * * based on the pre-generated OSA texture sampling offsets, * for anti-aliasing sharp shadow edges. */ VECCOPY(pos, shi->co); - if (shi->vlr && ((shi->vlr->flag & R_FULL_OSA) == 0)) { + if (shi->vlr && !full_osa) { QMC_sampleRect(jit, qsa_jit, shi->thread, samples, 1.0, 1.0); pos[0] += shi->dxco[0]*jit[0] + shi->dyco[0]*jit[1]; |