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 <lukasstockner97>2019-12-04 21:57:28 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-12-10 22:44:46 +0300
commite760972221e68d3c81f2ee3687cc71836dde8ae9 (patch)
treeb1a2efbb17c05a429e4509d336a1eb14c73cfb8c /intern/cycles/kernel/kernel_path.h
parent35b5888b157d05d378df3acc899d28856a9eb9a4 (diff)
Cycles: support for custom shader AOVs
Custom render passes are added in the Shader AOVs panel in the view layer settings, with a name and data type. In shader nodes, an AOV Output node is then used to output either a value or color to the pass. Arbitrary names can be used for these passes, as long as they don't conflict with built-in passes that are enabled. The AOV Output node can be used in both material and world shader nodes. Implemented by Lukas, with tweaks by Brecht. Differential Revision: https://developer.blender.org/D4837
Diffstat (limited to 'intern/cycles/kernel/kernel_path.h')
-rw-r--r--intern/cycles/kernel/kernel_path.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h
index 55abe39c465..693efad8c50 100644
--- a/intern/cycles/kernel/kernel_path.h
+++ b/intern/cycles/kernel/kernel_path.h
@@ -27,6 +27,7 @@
#include "kernel/geom/geom.h"
#include "kernel/bvh/bvh.h"
+#include "kernel/kernel_write_passes.h"
#include "kernel/kernel_accumulate.h"
#include "kernel/kernel_shader.h"
#include "kernel/kernel_light.h"
@@ -116,6 +117,7 @@ ccl_device_forceinline void kernel_path_background(KernelGlobals *kg,
ccl_addr_space Ray *ray,
float3 throughput,
ShaderData *sd,
+ ccl_global float *buffer,
PathRadiance *L)
{
/* eval background shader if nothing hit */
@@ -136,7 +138,7 @@ ccl_device_forceinline void kernel_path_background(KernelGlobals *kg,
#ifdef __BACKGROUND__
/* sample background shader */
- float3 L_background = indirect_background(kg, sd, state, ray);
+ float3 L_background = indirect_background(kg, sd, state, buffer, ray);
path_radiance_accum_background(L, state, throughput, L_background);
#endif /* __BACKGROUND__ */
}
@@ -267,7 +269,7 @@ ccl_device_forceinline bool kernel_path_shader_apply(KernelGlobals *kg,
float3 bg = make_float3(0.0f, 0.0f, 0.0f);
if (!kernel_data.background.transparent) {
- bg = indirect_background(kg, emission_sd, state, ray);
+ bg = indirect_background(kg, emission_sd, state, NULL, ray);
}
path_radiance_accum_shadowcatcher(L, throughput, bg);
}
@@ -418,7 +420,7 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg,
/* Shade background. */
if (!hit) {
- kernel_path_background(kg, state, ray, throughput, sd, L);
+ kernel_path_background(kg, state, ray, throughput, sd, NULL, L);
break;
}
else if (path_state_ao_bounce(kg, state)) {
@@ -434,7 +436,7 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg,
# endif
/* Evaluate shader. */
- shader_eval_surface(kg, sd, state, state->flag);
+ shader_eval_surface(kg, sd, state, NULL, state->flag);
shader_prepare_closures(sd, state);
/* Apply shadow catcher, holdout, emission. */
@@ -556,7 +558,7 @@ ccl_device_forceinline void kernel_path_integrate(KernelGlobals *kg,
/* Shade background. */
if (!hit) {
- kernel_path_background(kg, state, ray, throughput, &sd, L);
+ kernel_path_background(kg, state, ray, throughput, &sd, buffer, L);
break;
}
else if (path_state_ao_bounce(kg, state)) {
@@ -572,7 +574,7 @@ ccl_device_forceinline void kernel_path_integrate(KernelGlobals *kg,
# endif
/* Evaluate shader. */
- shader_eval_surface(kg, &sd, state, state->flag);
+ shader_eval_surface(kg, &sd, state, buffer, state->flag);
shader_prepare_closures(&sd, state);
/* Apply shadow catcher, holdout, emission. */