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:
Diffstat (limited to 'intern/cycles/kernel/kernel_shadow.h')
-rw-r--r--intern/cycles/kernel/kernel_shadow.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/intern/cycles/kernel/kernel_shadow.h b/intern/cycles/kernel/kernel_shadow.h
index db2fc84834a..95b57404a77 100644
--- a/intern/cycles/kernel/kernel_shadow.h
+++ b/intern/cycles/kernel/kernel_shadow.h
@@ -125,14 +125,14 @@ ccl_device_inline bool shadow_blocked(KernelGlobals *kg, ShaderData *shadow_sd,
/* stop if all light is blocked */
if(is_zero(throughput)) {
- /* free dynamic storage */
return true;
}
/* move ray forward */
ray->P = shadow_sd->P;
- if(ray->t != FLT_MAX)
+ if(ray->t != FLT_MAX) {
ray->D = normalize_len(Pend - ray->P, &ray->t);
+ }
#ifdef __VOLUME__
/* exit/enter volume */
@@ -234,8 +234,9 @@ ccl_device_noinline bool shadow_blocked(KernelGlobals *kg,
return false;
}
- if(!shader_transparent_shadow(kg, isect))
+ if(!shader_transparent_shadow(kg, isect)) {
return true;
+ }
#ifdef __VOLUME__
/* attenuation between last surface and next surface */
@@ -258,13 +259,16 @@ ccl_device_noinline bool shadow_blocked(KernelGlobals *kg,
throughput *= shader_bsdf_transparency(kg, shadow_sd);
}
- if(is_zero(throughput))
+ /* stop if all light is blocked */
+ if(is_zero(throughput)) {
return true;
+ }
/* move ray forward */
ray->P = ray_offset(ccl_fetch(shadow_sd, P), -ccl_fetch(shadow_sd, Ng));
- if(ray->t != FLT_MAX)
+ if(ray->t != FLT_MAX) {
ray->D = normalize_len(Pend - ray->P, &ray->t);
+ }
#ifdef __VOLUME__
/* exit/enter volume */