Cycles: Delay shooting SSS indirect rays
[blender-staging.git] / intern / cycles / kernel / kernel_types.h
index 1d71e6435dbb5091424c6ae890b6eedeb9894628..bef00355c5e1b8cc0e8bee0bdd143bbdcf700d94 100644 (file)
@@ -37,7 +37,7 @@ CCL_NAMESPACE_BEGIN
 #define OBJECT_SIZE            11
 #define OBJECT_VECTOR_SIZE     6
 #define LIGHT_SIZE                     5
-#define FILTER_TABLE_SIZE      256
+#define FILTER_TABLE_SIZE      1024
 #define RAMP_TABLE_SIZE                256
 #define SHUTTER_TABLE_SIZE             256
 #define PARTICLE_SIZE          5
@@ -180,7 +180,7 @@ CCL_NAMESPACE_BEGIN
 #  define __KERNEL_DEBUG__
 #endif
 
-/* Scene-based selective featrues compilation/ */
+/* Scene-based selective featrues compilation. */
 #ifdef __NO_CAMERA_MOTION__
 #  undef __CAMERA_MOTION__
 #endif
@@ -190,6 +190,12 @@ CCL_NAMESPACE_BEGIN
 #ifdef __NO_HAIR__
 #  undef __HAIR__
 #endif
+#ifdef __NO_SUBSURFACE__
+#  undef __SUBSURFACE__
+#endif
+#ifdef __NO_BRANCHED_PATH__
+#  undef __BRANCHED_PATH__
+#endif
 
 /* Random Numbers */
 
@@ -746,6 +752,30 @@ typedef struct PathState {
 #endif
 } PathState;
 
+/* Subsurface */
+
+/* Struct to gather multiple SSS hits. */
+struct SubsurfaceIntersection
+{
+       Ray ray;
+       float3 weight[BSSRDF_MAX_HITS];
+
+       int num_hits;
+       Intersection hits[BSSRDF_MAX_HITS];
+       float3 Ng[BSSRDF_MAX_HITS];
+};
+
+/* Struct to gather SSS indirect rays and delay tracing them. */
+struct SubsurfaceIndirectRays
+{
+       bool need_update_volume_stack;
+       PathState state;
+
+       int num_rays;
+       Ray rays[BSSRDF_MAX_HITS];
+       float3 throughputs[BSSRDF_MAX_HITS];
+};
+
 /* Constant Kernel Data
  *
  * These structs are passed from CPU to various devices, and the struct layout