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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-01-10 16:35:09 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-01-10 16:35:09 +0400
commit04754cc1125fce8c6c9881e81a70e3e1b8748598 (patch)
treed14431fe859765facbaf4d5b0f1bcf3c852d18e3 /intern/cycles/kernel/kernel_light.h
parent273cf512dd8915e5360e8dc33471c89ef2a5e836 (diff)
Fix too bright result in background multiple importance after recent changes.
Diffstat (limited to 'intern/cycles/kernel/kernel_light.h')
-rw-r--r--intern/cycles/kernel/kernel_light.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/intern/cycles/kernel/kernel_light.h b/intern/cycles/kernel/kernel_light.h
index df5acca6e65..eafe1d3d96b 100644
--- a/intern/cycles/kernel/kernel_light.h
+++ b/intern/cycles/kernel/kernel_light.h
@@ -243,7 +243,7 @@ __device void lamp_light_sample(KernelGlobals *kg, int lamp,
float costheta = dot(lightD, D);
ls->pdf = invarea/(costheta*costheta*costheta);
- ls->eval_fac = ls->pdf;
+ ls->eval_fac = ls->pdf*kernel_data.integrator.inv_pdf_lights;
}
#ifdef __BACKGROUND_MIS__
else if(type == LIGHT_BACKGROUND) {
@@ -302,23 +302,18 @@ __device void lamp_light_sample(KernelGlobals *kg, int lamp,
invarea = 1.0f;
}
- ls->pdf = invarea;
ls->eval_fac = 0.25f*ls->pdf;
+ ls->pdf = invarea;
}
+
+ ls->eval_fac *= kernel_data.integrator.inv_pdf_lights;
+ ls->pdf *= lamp_light_pdf(kg, ls->Ng, -ls->D, ls->t);
}
ls->shader = __float_as_int(data1.x);
ls->object = ~0;
ls->prim = ~0;
ls->lamp = lamp;
-
- /* compute pdf */
- if(ls->t != FLT_MAX)
- ls->pdf *= lamp_light_pdf(kg, ls->Ng, -ls->D, ls->t);
-
- /* this is a bit weak, but we don't want this as part of the pdf for
- * multiple importance sampling */
- ls->eval_fac *= kernel_data.integrator.inv_pdf_lights;
}
__device bool lamp_light_eval(KernelGlobals *kg, int lamp, float3 P, float3 D, float t, LightSample *ls)