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>2017-11-01 21:00:42 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2017-11-05 20:13:44 +0300
commit2c02a04c464c2f5c6e211ceb7b21255eaca7e087 (patch)
tree005c4b99ecf43db7513e9b5c2dfcaca56e1608a1 /intern/cycles/kernel/kernel_types.h
parentcac3d4d16691d77e8e01f158be07d182e56e9755 (diff)
Code refactor: remove emission and background closures, sum directly.
Diffstat (limited to 'intern/cycles/kernel/kernel_types.h')
-rw-r--r--intern/cycles/kernel/kernel_types.h28
1 files changed, 17 insertions, 11 deletions
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index d1733d8a6e7..acd06b57a81 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -812,7 +812,7 @@ enum ShaderDataFlag {
/* Set when ray hits backside of surface. */
SD_BACKFACING = (1 << 0),
- /* Shader has emissive closure. */
+ /* Shader has non-zero emission. */
SD_EMISSION = (1 << 1),
/* Shader has BSDF closure. */
SD_BSDF = (1 << 2),
@@ -970,16 +970,6 @@ typedef ccl_addr_space struct ShaderData {
Transform ob_itfm;
#endif
- /* Closure data, we store a fixed array of closures */
- struct ShaderClosure closure[MAX_CLOSURE];
- int num_closure;
- int num_closure_extra;
- float randb_closure;
- float3 svm_closure_weight;
-
- /* LCG state for closures that require additional random numbers. */
- uint lcg_state;
-
/* ray start position, only set for backgrounds */
float3 ray_P;
differential3 ray_dP;
@@ -988,6 +978,22 @@ typedef ccl_addr_space struct ShaderData {
struct KernelGlobals *osl_globals;
struct PathState *osl_path_state;
#endif
+
+ /* LCG state for closures that require additional random numbers. */
+ uint lcg_state;
+
+ /* Closure data, we store a fixed array of closures */
+ int num_closure;
+ int num_closure_extra;
+ float randb_closure;
+ float3 svm_closure_weight;
+
+ /* Closure weights summed directly, so we can evaluate
+ * emission and shadow transparency with MAX_CLOSURE 0. */
+ float3 closure_emission_background;
+
+ /* At the end so we can adjust size in ShaderDataTinyStorage. */
+ struct ShaderClosure closure[MAX_CLOSURE];
} ShaderData;
/* Path State */