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:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-11-22 13:48:33 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-11-25 11:01:22 +0300
commit2a5c1fc9ccbabfaef4eeaf90093dfb2ac0acfc90 (patch)
tree98ee26786419e78d9fa0e325c527bf2e1fa3d905 /intern/cycles/kernel/kernel_types.h
parent8bca34fe326d10cc2f20df7fa541179e9ba835d2 (diff)
Cycles: Delay shooting SSS indirect rays
The idea is to delay shooting indirect rays for the SSS sampling and trace them after the main integration loop was finished. This reduces GPU stack usage even further and brings it down to around 652MB (comparing to 722MB before the change and 946MB with previous stable release). This also solves the speed regression happened in the previous commit and now simple SSS scene (SSS suzanne on the floor) renders in 0:50 (comparing to 1:16 with previous commit and 1:03 with official release).
Diffstat (limited to 'intern/cycles/kernel/kernel_types.h')
-rw-r--r--intern/cycles/kernel/kernel_types.h36
1 files changed, 24 insertions, 12 deletions
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index e04f500e410..bef00355c5e 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -520,18 +520,6 @@ typedef ccl_addr_space struct Intersection {
#endif
} Intersection;
-/* Subsurface Intersection result */
-
-struct SubsurfaceIntersection
-{
- Ray ray;
- float3 weight[BSSRDF_MAX_HITS];
-
- int num_hits;
- struct Intersection hits[BSSRDF_MAX_HITS];
- float3 Ng[BSSRDF_MAX_HITS];
-};
-
/* Primitives */
typedef enum PrimitiveType {
@@ -764,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