diff options
author | Hristo Gueorguiev <prem.nirved@gmail.com> | 2017-03-08 17:42:26 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-03-09 19:09:37 +0300 |
commit | 57e26627c485baab63e108821b2712d5e234ae7c (patch) | |
tree | e3ee5aa4bf759121559c69504b77d600552bf527 /intern/cycles/kernel/kernels | |
parent | 6c942db30dee14eb37229879656fa049a9ac6df6 (diff) |
Cycles: SSS and Volume rendering in split kernel
Decoupled ray marching is not supported yet.
Transparent shadows are always enabled for volume rendering.
Changes in kernel/bvh and kernel/geom are from Sergey.
This simiplifies code significantly, and prepares it for
record-all transparent shadow function in split kernel.
Diffstat (limited to 'intern/cycles/kernel/kernels')
-rw-r--r-- | intern/cycles/kernel/kernels/cpu/kernel_cpu.h | 6 | ||||
-rw-r--r-- | intern/cycles/kernel/kernels/cpu/kernel_cpu_impl.h | 18 | ||||
-rw-r--r-- | intern/cycles/kernel/kernels/opencl/kernel_buffer_update.cl (renamed from intern/cycles/kernel/kernels/opencl/kernel_background_buffer_update.cl) | 6 | ||||
-rw-r--r-- | intern/cycles/kernel/kernels/opencl/kernel_do_volume.cl | 26 | ||||
-rw-r--r-- | intern/cycles/kernel/kernels/opencl/kernel_indirect_background.cl | 26 | ||||
-rw-r--r-- | intern/cycles/kernel/kernels/opencl/kernel_indirect_subsurface.cl | 26 | ||||
-rw-r--r-- | intern/cycles/kernel/kernels/opencl/kernel_split.cl | 34 | ||||
-rw-r--r-- | intern/cycles/kernel/kernels/opencl/kernel_subsurface_scatter.cl | 26 |
8 files changed, 161 insertions, 7 deletions
diff --git a/intern/cycles/kernel/kernels/cpu/kernel_cpu.h b/intern/cycles/kernel/kernels/cpu/kernel_cpu.h index deb872444d0..8ce420d8a48 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_cpu.h +++ b/intern/cycles/kernel/kernels/cpu/kernel_cpu.h @@ -74,13 +74,17 @@ void KERNEL_FUNCTION_FULL_NAME(data_init)( DECLARE_SPLIT_KERNEL_FUNCTION(path_init) DECLARE_SPLIT_KERNEL_FUNCTION(scene_intersect) DECLARE_SPLIT_KERNEL_FUNCTION(lamp_emission) +DECLARE_SPLIT_KERNEL_FUNCTION(do_volume) DECLARE_SPLIT_KERNEL_FUNCTION(queue_enqueue) -DECLARE_SPLIT_KERNEL_FUNCTION(background_buffer_update) +DECLARE_SPLIT_KERNEL_FUNCTION(indirect_background) DECLARE_SPLIT_KERNEL_FUNCTION(shader_eval) DECLARE_SPLIT_KERNEL_FUNCTION(holdout_emission_blurring_pathtermination_ao) +DECLARE_SPLIT_KERNEL_FUNCTION(subsurface_scatter) DECLARE_SPLIT_KERNEL_FUNCTION(direct_lighting) DECLARE_SPLIT_KERNEL_FUNCTION(shadow_blocked) DECLARE_SPLIT_KERNEL_FUNCTION(next_iteration_setup) +DECLARE_SPLIT_KERNEL_FUNCTION(indirect_subsurface) +DECLARE_SPLIT_KERNEL_FUNCTION(buffer_update) void KERNEL_FUNCTION_FULL_NAME(register_functions)(void(*reg)(const char* name, void* func)); diff --git a/intern/cycles/kernel/kernels/cpu/kernel_cpu_impl.h b/intern/cycles/kernel/kernels/cpu/kernel_cpu_impl.h index d6d0db4e034..8c519a21d95 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_cpu_impl.h +++ b/intern/cycles/kernel/kernels/cpu/kernel_cpu_impl.h @@ -41,13 +41,17 @@ # include "split/kernel_path_init.h" # include "split/kernel_scene_intersect.h" # include "split/kernel_lamp_emission.h" +# include "split/kernel_do_volume.h" # include "split/kernel_queue_enqueue.h" -# include "split/kernel_background_buffer_update.h" +# include "split/kernel_indirect_background.h" # include "split/kernel_shader_eval.h" # include "split/kernel_holdout_emission_blurring_pathtermination_ao.h" +# include "split/kernel_subsurface_scatter.h" # include "split/kernel_direct_lighting.h" # include "split/kernel_shadow_blocked.h" # include "split/kernel_next_iteration_setup.h" +# include "split/kernel_indirect_subsurface.h" +# include "split/kernel_buffer_update.h" #endif CCL_NAMESPACE_BEGIN @@ -166,13 +170,17 @@ void KERNEL_FUNCTION_FULL_NAME(shader)(KernelGlobals *kg, DEFINE_SPLIT_KERNEL_FUNCTION(path_init) DEFINE_SPLIT_KERNEL_FUNCTION(scene_intersect) DEFINE_SPLIT_KERNEL_FUNCTION(lamp_emission) +DEFINE_SPLIT_KERNEL_FUNCTION(do_volume) DEFINE_SPLIT_KERNEL_FUNCTION(queue_enqueue) -DEFINE_SPLIT_KERNEL_FUNCTION(background_buffer_update) +DEFINE_SPLIT_KERNEL_FUNCTION(indirect_background) DEFINE_SPLIT_KERNEL_FUNCTION(shader_eval) DEFINE_SPLIT_KERNEL_FUNCTION(holdout_emission_blurring_pathtermination_ao) +DEFINE_SPLIT_KERNEL_FUNCTION(subsurface_scatter) DEFINE_SPLIT_KERNEL_FUNCTION(direct_lighting) DEFINE_SPLIT_KERNEL_FUNCTION(shadow_blocked) DEFINE_SPLIT_KERNEL_FUNCTION(next_iteration_setup) +DEFINE_SPLIT_KERNEL_FUNCTION(indirect_subsurface) +DEFINE_SPLIT_KERNEL_FUNCTION(buffer_update) void KERNEL_FUNCTION_FULL_NAME(register_functions)(void(*reg)(const char* name, void* func)) { @@ -189,13 +197,17 @@ void KERNEL_FUNCTION_FULL_NAME(register_functions)(void(*reg)(const char* name, REGISTER(path_init); REGISTER(scene_intersect); REGISTER(lamp_emission); + REGISTER(do_volume); REGISTER(queue_enqueue); - REGISTER(background_buffer_update); + REGISTER(indirect_background); REGISTER(shader_eval); REGISTER(holdout_emission_blurring_pathtermination_ao); + REGISTER(subsurface_scatter); REGISTER(direct_lighting); REGISTER(shadow_blocked); REGISTER(next_iteration_setup); + REGISTER(indirect_subsurface); + REGISTER(buffer_update); #undef REGISTER #undef REGISTER_EVAL_NAME diff --git a/intern/cycles/kernel/kernels/opencl/kernel_background_buffer_update.cl b/intern/cycles/kernel/kernels/opencl/kernel_buffer_update.cl index 47e363f6e03..d3058501f27 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_background_buffer_update.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_buffer_update.cl @@ -16,11 +16,11 @@ #include "kernel_compat_opencl.h" #include "split/kernel_split_common.h" -#include "split/kernel_background_buffer_update.h" +#include "split/kernel_buffer_update.h" -__kernel void kernel_ocl_path_trace_background_buffer_update( +__kernel void kernel_ocl_path_trace_buffer_update( KernelGlobals *kg, ccl_constant KernelData *data) { - kernel_background_buffer_update(kg); + kernel_buffer_update(kg); } diff --git a/intern/cycles/kernel/kernels/opencl/kernel_do_volume.cl b/intern/cycles/kernel/kernels/opencl/kernel_do_volume.cl new file mode 100644 index 00000000000..6380e9cb746 --- /dev/null +++ b/intern/cycles/kernel/kernels/opencl/kernel_do_volume.cl @@ -0,0 +1,26 @@ +/* + * Copyright 2011-2017 Blender Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "kernel_compat_opencl.h" +#include "split/kernel_split_common.h" +#include "split/kernel_do_volume.h" + +__kernel void kernel_ocl_path_trace_do_volume( + KernelGlobals *kg, + ccl_constant KernelData *data) +{ + kernel_do_volume(kg); +} diff --git a/intern/cycles/kernel/kernels/opencl/kernel_indirect_background.cl b/intern/cycles/kernel/kernels/opencl/kernel_indirect_background.cl new file mode 100644 index 00000000000..671501bf237 --- /dev/null +++ b/intern/cycles/kernel/kernels/opencl/kernel_indirect_background.cl @@ -0,0 +1,26 @@ +/* + * Copyright 2011-2017 Blender Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "kernel_compat_opencl.h" +#include "split/kernel_split_common.h" +#include "split/kernel_indirect_background.h" + +__kernel void kernel_ocl_path_trace_indirect_background( + KernelGlobals *kg, + ccl_constant KernelData *data) +{ + kernel_indirect_background(kg); +} diff --git a/intern/cycles/kernel/kernels/opencl/kernel_indirect_subsurface.cl b/intern/cycles/kernel/kernels/opencl/kernel_indirect_subsurface.cl new file mode 100644 index 00000000000..b5e52e81ebf --- /dev/null +++ b/intern/cycles/kernel/kernels/opencl/kernel_indirect_subsurface.cl @@ -0,0 +1,26 @@ +/* + * Copyright 2011-2017 Blender Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "kernel_compat_opencl.h" +#include "split/kernel_split_common.h" +#include "split/kernel_indirect_subsurface.h" + +__kernel void kernel_ocl_path_trace_indirect_subsurface( + KernelGlobals *kg, + ccl_constant KernelData *data) +{ + kernel_indirect_subsurface(kg); +} diff --git a/intern/cycles/kernel/kernels/opencl/kernel_split.cl b/intern/cycles/kernel/kernels/opencl/kernel_split.cl new file mode 100644 index 00000000000..7a947c48e60 --- /dev/null +++ b/intern/cycles/kernel/kernels/opencl/kernel_split.cl @@ -0,0 +1,34 @@ +/* + * Copyright 2011-2017 Blender Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "kernel_state_buffer_size.cl" +#include "kernel_data_init.cl" +#include "kernel_path_init.cl" + +#include "kernel_scene_intersect.cl" +#include "kernel_lamp_emission.cl" +#include "kernel_do_volume.cl" +#include "kernel_indirect_background.cl" +#include "kernel_queue_enqueue.cl" +#include "kernel_shader_eval.cl" +#include "kernel_holdout_emission_blurring_pathtermination_ao.cl" +#include "kernel_subsurface_scatter.cl" +#include "kernel_direct_lighting.cl" +#include "kernel_shadow_blocked.cl" +#include "kernel_next_iteration_setup.cl" +#include "kernel_indirect_subsurface.cl" +#include "kernel_buffer_update.cl" + diff --git a/intern/cycles/kernel/kernels/opencl/kernel_subsurface_scatter.cl b/intern/cycles/kernel/kernels/opencl/kernel_subsurface_scatter.cl new file mode 100644 index 00000000000..8dae79bacb0 --- /dev/null +++ b/intern/cycles/kernel/kernels/opencl/kernel_subsurface_scatter.cl @@ -0,0 +1,26 @@ +/* + * Copyright 2011-2017 Blender Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "kernel_compat_opencl.h" +#include "split/kernel_split_common.h" +#include "split/kernel_subsurface_scatter.h" + +__kernel void kernel_ocl_path_trace_subsurface_scatter( + KernelGlobals *kg, + ccl_constant KernelData *data) +{ + kernel_subsurface_scatter(kg); +} |