diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-01-25 21:23:52 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-01-25 21:23:52 +0400 |
commit | f99343d3b8676543e2bd6acd6ee2274c21b1b388 (patch) | |
tree | fd40cd33691a783f82cf877e774d1b3a64d91ed3 /intern/cycles/kernel/kernel_types.h | |
parent | 14f475fccad7158098ddecc285c617f990b2f8b5 (diff) |
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
Diffstat (limited to 'intern/cycles/kernel/kernel_types.h')
-rw-r--r-- | intern/cycles/kernel/kernel_types.h | 99 |
1 files changed, 98 insertions, 1 deletions
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index 008ec0bdf28..b4b1da83162 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -70,6 +70,9 @@ CCL_NAMESPACE_BEGIN #ifdef __KERNEL_ADV_SHADING__ #define __MULTI_CLOSURE__ #define __TRANSPARENT_SHADOWS__ +#ifdef __KERNEL_CPU__ +#define __PASSES__ +#endif #endif //#define __MULTI_LIGHT__ @@ -150,6 +153,75 @@ typedef enum ClosureLabel { LABEL_STOP = 2048 } ClosureLabel; +/* Render Passes */ + +typedef enum PassType { + PASS_NONE = 0, + PASS_COMBINED = 1, + PASS_DEPTH = 2, + PASS_NORMAL = 8, + PASS_UV = 16, + PASS_OBJECT_ID = 32, + PASS_MATERIAL_ID = 64, + PASS_DIFFUSE_COLOR = 128, + PASS_GLOSSY_COLOR = 256, + PASS_TRANSMISSION_COLOR = 512, + PASS_DIFFUSE_INDIRECT = 1024, + PASS_GLOSSY_INDIRECT = 2048, + PASS_TRANSMISSION_INDIRECT = 4096, + PASS_DIFFUSE_DIRECT = 8192, + PASS_GLOSSY_DIRECT = 16384, + PASS_TRANSMISSION_DIRECT = 32768, + PASS_EMISSION = 65536, + PASS_BACKGROUND = 131072 +} PassType; + +#define PASS_ALL (~0) + +#ifdef __PASSES__ + +typedef float3 PathThroughput; + +struct PathRadiance { + int use_light_pass; + + float3 indirect; + float3 direct_throughput; + float3 direct_emission; + + float3 color_diffuse; + float3 color_glossy; + float3 color_transmission; + + float3 direct_diffuse; + float3 direct_glossy; + float3 direct_transmission; + + float3 indirect_diffuse; + float3 indirect_glossy; + float3 indirect_transmission; + + float3 emission; + float3 background; +}; + +struct BsdfEval { + int use_light_pass; + + float3 diffuse; + float3 glossy; + float3 transmission; + float3 transparent; +}; + +#else + +typedef float3 PathThroughput; +typedef float3 PathRadiance; +typedef float3 BsdfEval; + +#endif + /* Shader Flag */ typedef enum ShaderFlag { @@ -353,7 +425,32 @@ typedef struct KernelCamera { typedef struct KernelFilm { float exposure; - int pad1, pad2, pad3; + int pass_flag; + int pass_stride; + int use_light_pass; + + int pass_combined; + int pass_depth; + int pass_normal; + int pass_pad; + + int pass_uv; + int pass_object_id; + int pass_material_id; + int pass_diffuse_color; + + int pass_glossy_color; + int pass_transmission_color; + int pass_diffuse_indirect; + int pass_glossy_indirect; + + int pass_transmission_indirect; + int pass_diffuse_direct; + int pass_glossy_direct; + int pass_transmission_direct; + + int pass_emission; + int pass_background; } KernelFilm; typedef struct KernelBackground { |