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:
authorLukas Stockner <lukas.stockner@freenet.de>2017-11-14 09:21:07 +0300
committerLukas Stockner <lukas.stockner@freenet.de>2017-11-17 18:39:45 +0300
commita0c02e4d1b87f4e83c0dfe794f28482030be9896 (patch)
treead2b5bdcdb89831d7db2964cf9dc56fc84124b4c /intern/cycles/kernel
parentf78e963858afb6f556e1b4c6d6b02a95ba11834b (diff)
Cycles: Add Volume Direct and Volume Indirect passes for volume-scattered light
No color pass because it's hard to define what to use as color in a volume. Reviewers: sergey, brecht Differential Revision: https://developer.blender.org/D2903
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r--intern/cycles/kernel/kernel_accumulate.h1
-rw-r--r--intern/cycles/kernel/kernel_passes.h4
-rw-r--r--intern/cycles/kernel/kernel_types.h9
3 files changed, 11 insertions, 3 deletions
diff --git a/intern/cycles/kernel/kernel_accumulate.h b/intern/cycles/kernel/kernel_accumulate.h
index 366f25422fd..7c1b2a015e1 100644
--- a/intern/cycles/kernel/kernel_accumulate.h
+++ b/intern/cycles/kernel/kernel_accumulate.h
@@ -187,7 +187,6 @@ ccl_device_inline void path_radiance_init(PathRadiance *L, int use_light_pass)
L->color_glossy = make_float3(0.0f, 0.0f, 0.0f);
L->color_transmission = make_float3(0.0f, 0.0f, 0.0f);
L->color_subsurface = make_float3(0.0f, 0.0f, 0.0f);
- L->color_scatter = make_float3(0.0f, 0.0f, 0.0f);
L->direct_diffuse = make_float3(0.0f, 0.0f, 0.0f);
L->direct_glossy = make_float3(0.0f, 0.0f, 0.0f);
diff --git a/intern/cycles/kernel/kernel_passes.h b/intern/cycles/kernel/kernel_passes.h
index 4236e2c5d4f..29451b6b8b6 100644
--- a/intern/cycles/kernel/kernel_passes.h
+++ b/intern/cycles/kernel/kernel_passes.h
@@ -294,6 +294,8 @@ ccl_device_inline void kernel_write_light_passes(KernelGlobals *kg, ccl_global f
kernel_write_pass_float3(buffer + kernel_data.film.pass_transmission_indirect, L->indirect_transmission);
if(light_flag & PASSMASK(SUBSURFACE_INDIRECT))
kernel_write_pass_float3(buffer + kernel_data.film.pass_subsurface_indirect, L->indirect_subsurface);
+ if(light_flag & PASSMASK(VOLUME_INDIRECT))
+ kernel_write_pass_float3(buffer + kernel_data.film.pass_volume_indirect, L->indirect_scatter);
if(light_flag & PASSMASK(DIFFUSE_DIRECT))
kernel_write_pass_float3(buffer + kernel_data.film.pass_diffuse_direct, L->direct_diffuse);
if(light_flag & PASSMASK(GLOSSY_DIRECT))
@@ -302,6 +304,8 @@ ccl_device_inline void kernel_write_light_passes(KernelGlobals *kg, ccl_global f
kernel_write_pass_float3(buffer + kernel_data.film.pass_transmission_direct, L->direct_transmission);
if(light_flag & PASSMASK(SUBSURFACE_DIRECT))
kernel_write_pass_float3(buffer + kernel_data.film.pass_subsurface_direct, L->direct_subsurface);
+ if(light_flag & PASSMASK(VOLUME_DIRECT))
+ kernel_write_pass_float3(buffer + kernel_data.film.pass_volume_direct, L->direct_scatter);
if(light_flag & PASSMASK(EMISSION))
kernel_write_pass_float3(buffer + kernel_data.film.pass_emission, L->emission);
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index 1761ab22bd6..b6a9cf5f285 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -413,6 +413,9 @@ typedef enum PassType {
PASS_SUBSURFACE_DIRECT,
PASS_SUBSURFACE_INDIRECT,
PASS_SUBSURFACE_COLOR,
+ PASS_VOLUME_DIRECT,
+ PASS_VOLUME_INDIRECT,
+ /* No Scatter color since it's tricky to define what it would even mean. */
PASS_CATEGORY_LIGHT_END = 63,
} PassType;
@@ -521,7 +524,6 @@ typedef ccl_addr_space struct PathRadiance {
float3 color_glossy;
float3 color_transmission;
float3 color_subsurface;
- float3 color_scatter;
float3 direct_diffuse;
float3 direct_glossy;
@@ -1214,11 +1216,13 @@ typedef struct KernelFilm {
int pass_glossy_indirect;
int pass_transmission_indirect;
int pass_subsurface_indirect;
+ int pass_volume_indirect;
int pass_diffuse_direct;
int pass_glossy_direct;
int pass_transmission_direct;
int pass_subsurface_direct;
+ int pass_volume_direct;
int pass_emission;
int pass_background;
@@ -1237,7 +1241,8 @@ typedef struct KernelFilm {
int pass_denoising_data;
int pass_denoising_clean;
int denoising_flags;
- int pad;
+
+ int pad1, pad2, pad3;
#ifdef __KERNEL_DEBUG__
int pass_bvh_traversed_nodes;