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@gmail.com>2014-04-23 01:47:19 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2014-04-23 03:35:27 +0400
commit0f85174d503535287bd5844620cfd22dfecd373e (patch)
treec61c246e46397188a466e2eaf8f7857a17f5c386 /intern/cycles/kernel/svm
parentf2c483d108a33cb30f3f9c984c289e98a25ce5c2 (diff)
Fix occasional wrong normal for curves with minimum width.
This caused a couple of fireflies in koro_final.blend. The wrong normal would cause the shading point to be set as backfacing, which triggered another bug with hair BSDFs on the backface of hair curves. That one is not fixed yet but there's a comment in the code about it now.
Diffstat (limited to 'intern/cycles/kernel/svm')
-rw-r--r--intern/cycles/kernel/svm/svm_closure.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/intern/cycles/kernel/svm/svm_closure.h b/intern/cycles/kernel/svm/svm_closure.h
index caae65487c4..fe3fe697bca 100644
--- a/intern/cycles/kernel/svm/svm_closure.h
+++ b/intern/cycles/kernel/svm/svm_closure.h
@@ -336,8 +336,14 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float *
if(sd->flag & SD_BACKFACING && sd->type & PRIMITIVE_ALL_CURVE) {
ShaderClosure *sc = svm_node_closure_get_bsdf(sd, mix_weight);
+
if(sc) {
- sc->weight = make_float3(1.0f,1.0f,1.0f);
+ /* todo: giving a fixed weight here will cause issues when
+ * mixing multiple BSDFS. energey will not be conserved and
+ * the throughput can blow up after multiple bounces. we
+ * better figure out a way to skip backfaces from rays
+ * spawned by transmission from the front */
+ sc->weight = make_float3(1.0f, 1.0f, 1.0f);
sc->N = N;
sd->flag |= bsdf_transparent_setup(sc);
}