Page MenuHome
Paste P527

Closure cutoff
ActivePublic

Authored by Sergey Sharybin (sergey) on Sep 5 2017, 1:32 PM.
loc.h b/intern/cycles/kernel/closure/alloc.h
index e799855a65e..f8a5e8d64d0 100644
--- a/intern/cycles/kernel/closure/alloc.h
+++ b/intern/cycles/kernel/closure/alloc.h
@@ -24,6 +24,10 @@ ccl_device ShaderClosure *closure_alloc(ShaderData *sd, int size, ClosureType ty
int num_closure_extra = sd->num_closure_extra;
if(num_closure + num_closure_extra >= MAX_CLOSURE)
return NULL;
+ float sample_weight = fabsf(average(weight));
+ if(sample_weight <= CLOSURE_WEIGHT_CUTOFF) {
+ return NULL;
+ }
ShaderClosure *sc = &sd->closure[num_closure];

Event Timeline

Sergey Sharybin (sergey) created this object with edit policy "Administrators".