Merged revision(s) 58779, 58783-58784 from trunk/blender into soc-2013-dingto.
authorThomas Dinges <blender@dingto.org>
Wed, 31 Jul 2013 21:49:10 +0000 (21:49 +0000)
committerThomas Dinges <blender@dingto.org>
Wed, 31 Jul 2013 21:49:10 +0000 (21:49 +0000)
27 files changed:
intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_session.cpp
intern/cycles/blender/blender_sync.cpp
intern/cycles/device/device.h
intern/cycles/device/device_cpu.cpp
intern/cycles/device/device_cuda.cpp
intern/cycles/device/device_multi.cpp
intern/cycles/kernel/kernel_accumulate.h
intern/cycles/kernel/kernel_passes.h
intern/cycles/kernel/kernel_shader.h
intern/cycles/kernel/kernel_textures.h
intern/cycles/kernel/kernel_types.h
intern/cycles/kernel/svm/svm_image.h
intern/cycles/render/film.cpp
intern/cycles/render/image.cpp
intern/cycles/render/image.h
intern/cycles/render/scene.cpp
intern/cycles/render/scene.h
release/datafiles/splash.png
release/datafiles/startup.blend
source/blender/blenkernel/BKE_node.h
source/blender/gpu/shaders/gpu_shader_material.glsl
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/intern/rna_render.c
source/blender/makesrna/intern/rna_scene.c
source/blender/nodes/composite/nodes/node_composite_image.c
source/blender/render/intern/source/render_result.c

index 1a17675cb71d83084f8318f2c0e689b0ec9399e5..b32b9ef48a4bf0145a8e76bb79627be29a99b0f5 100644 (file)
@@ -67,9 +67,7 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
         row.operator("render.cycles_sampling_preset_add", text="", icon="ZOOMOUT").remove_active = True
 
         row = layout.row()
-        sub = row.row()
-        sub.active = (device_type == 'NONE' or cscene.device == 'CPU')
-        sub.prop(cscene, "progressive")
+        row.prop(cscene, "progressive")
         row.prop(cscene, "squared_samples")
         
         split = layout.split()
@@ -80,7 +78,7 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
         sub.prop(cscene, "seed")
         sub.prop(cscene, "sample_clamp")
 
-        if cscene.progressive or (device_type != 'NONE' and cscene.device == 'GPU'):
+        if cscene.progressive:
             col = split.column()
             sub = col.column(align=True)
             sub.label(text="Samples:")
@@ -371,7 +369,13 @@ class CyclesRender_PT_layer_passes(CyclesButtonsPanel, Panel):
         row.prop(rl, "use_pass_transmission_direct", text="Direct", toggle=True)
         row.prop(rl, "use_pass_transmission_indirect", text="Indirect", toggle=True)
         row.prop(rl, "use_pass_transmission_color", text="Color", toggle=True)
-
+        col.label(text="Subsurface:")
+        row = col.row(align=True)
+        row.prop(rl, "use_pass_subsurface_direct", text="Direct", toggle=True)
+        row.prop(rl, "use_pass_subsurface_indirect", text="Indirect", toggle=True)
+        row.prop(rl, "use_pass_subsurface_color", text="Color", toggle=True)
+        
+        col.separator()
         col.prop(rl, "use_pass_emit", text="Emission")
         col.prop(rl, "use_pass_environment")
         col.prop(rl, "use_pass_ambient_occlusion")
@@ -648,7 +652,6 @@ class CyclesLamp_PT_lamp(CyclesButtonsPanel, Panel):
         lamp = context.lamp
         clamp = lamp.cycles
         cscene = context.scene.cycles
-        device_type = context.user_preferences.system.compute_device_type
 
         layout.prop(lamp, "type", expand=True)
 
@@ -667,7 +670,7 @@ class CyclesLamp_PT_lamp(CyclesButtonsPanel, Panel):
                 sub.prop(lamp, "size", text="Size X")
                 sub.prop(lamp, "size_y", text="Size Y")
 
-        if not cscene.progressive and (device_type == 'NONE' or cscene.device == 'CPU'):
+        if not cscene.progressive:
             col.prop(clamp, "samples")
 
         col = split.column()
@@ -856,7 +859,6 @@ class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
         world = context.world
         cworld = world.cycles
         cscene = context.scene.cycles
-        device_type = context.user_preferences.system.compute_device_type
 
         col = layout.column()
 
@@ -864,7 +866,7 @@ class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
         sub = col.row(align=True)
         sub.active = cworld.sample_as_light
         sub.prop(cworld, "sample_map_resolution")
-        if not cscene.progressive and (device_type == 'NONE' or cscene.device == 'CPU'):
+        if not cscene.progressive:
             sub.prop(cworld, "samples")
 
 
index 3a46897fcac673284c71289aac12a7fd602cf205..fb743acf29af3c34643b532418a5c65dfdf9af2e 100644 (file)
@@ -216,6 +216,8 @@ static PassType get_pass_type(BL::RenderPass b_pass)
                        return PASS_GLOSSY_DIRECT;
                case BL::RenderPass::type_TRANSMISSION_DIRECT:
                        return PASS_TRANSMISSION_DIRECT;
+               case BL::RenderPass::type_SUBSURFACE_DIRECT:
+                       return PASS_SUBSURFACE_DIRECT;
 
                case BL::RenderPass::type_DIFFUSE_INDIRECT:
                        return PASS_DIFFUSE_INDIRECT;
@@ -223,6 +225,8 @@ static PassType get_pass_type(BL::RenderPass b_pass)
                        return PASS_GLOSSY_INDIRECT;
                case BL::RenderPass::type_TRANSMISSION_INDIRECT:
                        return PASS_TRANSMISSION_INDIRECT;
+               case BL::RenderPass::type_SUBSURFACE_INDIRECT:
+                       return PASS_SUBSURFACE_INDIRECT;
 
                case BL::RenderPass::type_DIFFUSE_COLOR:
                        return PASS_DIFFUSE_COLOR;
@@ -230,6 +234,8 @@ static PassType get_pass_type(BL::RenderPass b_pass)
                        return PASS_GLOSSY_COLOR;
                case BL::RenderPass::type_TRANSMISSION_COLOR:
                        return PASS_TRANSMISSION_COLOR;
+               case BL::RenderPass::type_SUBSURFACE_COLOR:
+                       return PASS_SUBSURFACE_COLOR;
 
                case BL::RenderPass::type_EMIT:
                        return PASS_EMISSION;
index 11e2be5e0fb0cd483f8e7d6540d86297a4979fcc..86a95e337efb960df789c3d6689537963337b131 100644 (file)
@@ -421,7 +421,7 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine b_engine, BL::Use
                preview_aa_samples = preview_aa_samples * preview_aa_samples;
        }
 
-       if(get_boolean(cscene, "progressive") == 0 && params.device.type == DEVICE_CPU) {
+       if(get_boolean(cscene, "progressive") == 0) {
                if(background) {
                        params.samples = aa_samples;
                }
index 7b31b9ba157e366af934de0c63a0a904d19d7c0f..e6d3922d3be53b21298ed7100fe3b4971b8d215b 100644 (file)
@@ -53,6 +53,7 @@ public:
        string description;
        string id;
        int num;
+       int extended_images;
        bool display_device;
        bool advanced_shading;
        bool pack_images;
@@ -63,6 +64,7 @@ public:
                type = DEVICE_CPU;
                id = "CPU";
                num = 0;
+               extended_images = false;
                display_device = false;
                advanced_shading = true;
                pack_images = false;
index 7bc84878dab6511df007fd1b5c6bc5fd0d1d48ae..f2743e15e2b7f364eedb13b92306aeb3bb78091f 100644 (file)
@@ -339,6 +339,7 @@ void device_cpu_info(vector<DeviceInfo>& devices)
        info.description = system_cpu_brand_string();
        info.id = "CPU";
        info.num = 0;
+       info.extended_images = true;
        info.advanced_shading = true;
        info.pack_images = false;
 
index 4441ff1c69fe708b0adbb257cc0223f34685bdfa..65dd001f70f6885b6492c18ae76cbfb678084d25 100644 (file)
@@ -1021,6 +1021,7 @@ void device_cuda_info(vector<DeviceInfo>& devices)
                int major, minor;
                cuDeviceComputeCapability(&major, &minor, num);
                info.advanced_shading = (major >= 2);
+               info.extended_images = (major >= 3);
                info.pack_images = false;
 
                /* if device has a kernel timeout, assume it is used for display */
index 807bfe578f30b2fe6b3ec69554db8590433da491..02db5b8483186453f39f60410a6123afbe0bc8d9 100644 (file)
@@ -330,6 +330,7 @@ static bool device_multi_add(vector<DeviceInfo>& devices, DeviceType type, bool
 
        info.advanced_shading = with_advanced_shading;
        info.pack_images = false;
+       info.extended_images = true;
 
        foreach(DeviceInfo& subinfo, devices) {
                if(subinfo.type == type) {
@@ -353,6 +354,7 @@ static bool device_multi_add(vector<DeviceInfo>& devices, DeviceType type, bool
                        if(subinfo.display_device)
                                info.display_device = true;
                        info.pack_images = info.pack_images || subinfo.pack_images;
+                       info.extended_images = info.extended_images && subinfo.extended_images;
                        num_added++;
                }
        }
index e6307f23b32f2e5f0cb828dd921246ba86809f93..9e26aa6fa2b74e7cefd26049b22dcbeda8863af0 100644 (file)
@@ -124,14 +124,17 @@ __device_inline void path_radiance_init(PathRadiance *L, int use_light_pass)
                L->color_diffuse = make_float3(0.0f, 0.0f, 0.0f);
                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->direct_diffuse = make_float3(0.0f, 0.0f, 0.0f);
                L->direct_glossy = make_float3(0.0f, 0.0f, 0.0f);
                L->direct_transmission = make_float3(0.0f, 0.0f, 0.0f);
+               L->direct_subsurface = make_float3(0.0f, 0.0f, 0.0f);
 
                L->indirect_diffuse = make_float3(0.0f, 0.0f, 0.0f);
                L->indirect_glossy = make_float3(0.0f, 0.0f, 0.0f);
                L->indirect_transmission = make_float3(0.0f, 0.0f, 0.0f);
+               L->indirect_subsurface = make_float3(0.0f, 0.0f, 0.0f);
 
                L->path_diffuse = make_float3(0.0f, 0.0f, 0.0f);
                L->path_glossy = make_float3(0.0f, 0.0f, 0.0f);
@@ -337,10 +340,12 @@ __device_inline void path_radiance_clamp(PathRadiance *L, float3 *L_sum, float c
                        L->direct_diffuse = make_float3(0.0f, 0.0f, 0.0f);
                        L->direct_glossy = make_float3(0.0f, 0.0f, 0.0f);
                        L->direct_transmission = make_float3(0.0f, 0.0f, 0.0f);
+                       L->direct_subsurface = make_float3(0.0f, 0.0f, 0.0f);
 
                        L->indirect_diffuse = make_float3(0.0f, 0.0f, 0.0f);
                        L->indirect_glossy = make_float3(0.0f, 0.0f, 0.0f);
                        L->indirect_transmission = make_float3(0.0f, 0.0f, 0.0f);
+                       L->indirect_subsurface = make_float3(0.0f, 0.0f, 0.0f);
 
                        L->emission = make_float3(0.0f, 0.0f, 0.0f);
                }
@@ -357,10 +362,12 @@ __device_inline void path_radiance_clamp(PathRadiance *L, float3 *L_sum, float c
                        L->direct_diffuse *= scale;
                        L->direct_glossy *= scale;
                        L->direct_transmission *= scale;
+                       L->direct_subsurface *= scale;
 
                        L->indirect_diffuse *= scale;
                        L->indirect_glossy *= scale;
                        L->indirect_transmission *= scale;
+                       L->indirect_subsurface *= scale;
 
                        L->emission *= scale;
                }
index f07e1b1fc649261dba7e7f7ac5bbabba65843817..0b45e2432831ea52a8921f4af6d45852cba1a3d1 100644 (file)
@@ -86,6 +86,8 @@ __device_inline void kernel_write_data_passes(KernelGlobals *kg, __global float
                L->color_glossy += shader_bsdf_glossy(kg, sd)*throughput;
        if(flag & (PASS_TRANSMISSION_INDIRECT|PASS_TRANSMISSION_COLOR|PASS_TRANSMISSION_DIRECT))
                L->color_transmission += shader_bsdf_transmission(kg, sd)*throughput;
+       if(flag & (PASS_SUBSURFACE_INDIRECT|PASS_SUBSURFACE_COLOR|PASS_SUBSURFACE_DIRECT))
+               L->color_subsurface += shader_bsdf_subsurface(kg, sd)*throughput;
 
        if(flag & PASS_MIST) {
                /* bring depth into 0..1 range */
@@ -128,12 +130,16 @@ __device_inline void kernel_write_light_passes(KernelGlobals *kg, __global float
                kernel_write_pass_float3(buffer + kernel_data.film.pass_glossy_indirect, sample, L->indirect_glossy);
        if(flag & PASS_TRANSMISSION_INDIRECT)
                kernel_write_pass_float3(buffer + kernel_data.film.pass_transmission_indirect, sample, L->indirect_transmission);
+       if(flag & PASS_SUBSURFACE_INDIRECT)
+               kernel_write_pass_float3(buffer + kernel_data.film.pass_subsurface_indirect, sample, L->indirect_subsurface);
        if(flag & PASS_DIFFUSE_DIRECT)
                kernel_write_pass_float3(buffer + kernel_data.film.pass_diffuse_direct, sample, L->direct_diffuse);
        if(flag & PASS_GLOSSY_DIRECT)
                kernel_write_pass_float3(buffer + kernel_data.film.pass_glossy_direct, sample, L->direct_glossy);
        if(flag & PASS_TRANSMISSION_DIRECT)
                kernel_write_pass_float3(buffer + kernel_data.film.pass_transmission_direct, sample, L->direct_transmission);
+       if(flag & PASS_SUBSURFACE_DIRECT)
+               kernel_write_pass_float3(buffer + kernel_data.film.pass_subsurface_direct, sample, L->direct_subsurface);
 
        if(flag & PASS_EMISSION)
                kernel_write_pass_float3(buffer + kernel_data.film.pass_emission, sample, L->emission);
@@ -148,6 +154,8 @@ __device_inline void kernel_write_light_passes(KernelGlobals *kg, __global float
                kernel_write_pass_float3(buffer + kernel_data.film.pass_glossy_color, sample, L->color_glossy);
        if(flag & PASS_TRANSMISSION_COLOR)
                kernel_write_pass_float3(buffer + kernel_data.film.pass_transmission_color, sample, L->color_transmission);
+       if(flag & PASS_SUBSURFACE_COLOR)
+               kernel_write_pass_float3(buffer + kernel_data.film.pass_subsurface_color, sample, L->color_subsurface);
        if(flag & PASS_SHADOW) {
                float4 shadow = L->shadow;
                shadow.w = kernel_data.film.pass_shadow_scale;
index b902230a9b90585c20e2851deca5f6c5fb4080f3..5fb349ff1ee16fae4b4ac7f1e1507be2628d35ac 100644 (file)
@@ -685,6 +685,27 @@ __device float3 shader_bsdf_transmission(KernelGlobals *kg, ShaderData *sd)
 #endif
 }
 
+__device float3 shader_bsdf_subsurface(KernelGlobals *kg, ShaderData *sd)
+{
+#ifdef __MULTI_CLOSURE__
+       float3 eval = make_float3(0.0f, 0.0f, 0.0f);
+
+       for(int i = 0; i< sd->num_closure; i++) {
+               ShaderClosure *sc = &sd->closure[i];
+
+               if(CLOSURE_IS_BSSRDF(sc->type))
+                       eval += sc->weight;
+       }
+
+       return eval;
+#else
+       if(CLOSURE_IS_BSSRDF(sd->closure.type))
+               return sd->closure.weight;
+       else
+               return make_float3(0.0f, 0.0f, 0.0f);
+#endif
+}
+
 __device float3 shader_bsdf_ao(KernelGlobals *kg, ShaderData *sd, float ao_factor, float3 *N)
 {
 #ifdef __MULTI_CLOSURE__
@@ -934,8 +955,11 @@ __device void shader_merge_closures(KernelGlobals *kg, ShaderData *sd)
                                sci->sample_weight += scj->sample_weight;
 
                                int size = sd->num_closure - (j+1);
-                               if(size > 0)
-                                       memmove(scj, scj+1, size*sizeof(ShaderClosure));
+                               if(size > 0) {
+                                       for(int k = 0; k < size; k++) {
+                                               scj[k] = scj[k+1];
+                                       }
+                               }
 
                                sd->num_closure--;
                                j--;
index 55c6e15ad04b20d0dc9631037c9b62c692c6522d..f09bb95046bc37177d4e3e856f2cc7ed535a4951 100644 (file)
@@ -176,6 +176,61 @@ KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_097)
 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_098)
 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_099)
 
+/* Kepler and above */
+#if defined(__KERNEL_CUDA__) && __CUDA_ARCH__ >= 300
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_100)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_101)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_102)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_103)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_104)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_105)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_106)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_107)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_108)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_109)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_110)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_111)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_112)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_113)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_114)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_115)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_116)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_117)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_118)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_119)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_120)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_121)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_122)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_123)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_124)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_125)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_126)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_127)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_128)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_129)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_130)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_131)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_132)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_133)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_134)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_135)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_136)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_137)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_138)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_139)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_140)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_141)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_142)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_143)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_144)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_145)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_146)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_147)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_148)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_149)
+KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_150)
+#endif
+
 /* packed image (opencl) */
 KERNEL_TEX(uchar4, texture_uchar4, __tex_image_packed)
 KERNEL_TEX(uint4, texture_uint4, __tex_image_packed_info)
index 1010fdea627e8cb497ab76e8637eabe034d1a369..1644f3eeb951a1f30158695615dc85d3de434df2 100644 (file)
@@ -68,6 +68,7 @@ CCL_NAMESPACE_BEGIN
 #define __KERNEL_SHADING__
 #if __CUDA_ARCH__ >= 200
 #define __KERNEL_ADV_SHADING__
+#define __NON_PROGRESSIVE__
 #endif
 #endif
 
@@ -268,7 +269,10 @@ typedef enum PassType {
        PASS_SHADOW = 262144,
        PASS_MOTION = 524288,
        PASS_MOTION_WEIGHT = 1048576,
-       PASS_MIST = 2097152
+       PASS_MIST = 2097152,
+       PASS_SUBSURFACE_DIRECT = 4194304,
+       PASS_SUBSURFACE_INDIRECT = 8388608,
+       PASS_SUBSURFACE_COLOR = 16777216
 } PassType;
 
 #define PASS_ALL (~0)
@@ -291,14 +295,17 @@ typedef struct PathRadiance {
        float3 color_diffuse;
        float3 color_glossy;
        float3 color_transmission;
+       float3 color_subsurface;
 
        float3 direct_diffuse;
        float3 direct_glossy;
        float3 direct_transmission;
+       float3 direct_subsurface;
 
        float3 indirect_diffuse;
        float3 indirect_glossy;
        float3 indirect_transmission;
+       float3 indirect_subsurface;
 
        float3 path_diffuse;
        float3 path_glossy;
@@ -672,22 +679,27 @@ typedef struct KernelFilm {
        int pass_diffuse_color;
        int pass_glossy_color;
        int pass_transmission_color;
+       int pass_subsurface_color;
+       
        int pass_diffuse_indirect;
-
        int pass_glossy_indirect;
        int pass_transmission_indirect;
+       int pass_subsurface_indirect;
+       
        int pass_diffuse_direct;
        int pass_glossy_direct;
-
        int pass_transmission_direct;
+       int pass_subsurface_direct;
+       
        int pass_emission;
        int pass_background;
        int pass_ao;
+       int pass_pad1;
 
        int pass_shadow;
        float pass_shadow_scale;
        int filter_table_offset;
-       int pass_pad1;
+       int pass_pad2;
 
        int pass_mist;
        float mist_start;
index 57adaa863f111a859ef16482c664b30b233ea3eb..037bfa2d9b9014672ad1c86424b1143f818c7add 100644 (file)
@@ -229,6 +229,60 @@ __device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y, u
                case 97: r = kernel_tex_image_interp(__tex_image_097, x, y); break;
                case 98: r = kernel_tex_image_interp(__tex_image_098, x, y); break;
                case 99: r = kernel_tex_image_interp(__tex_image_099, x, y); break;
+#if defined(__KERNEL_CUDA__) && __CUDA_ARCH__ >= 300
+               case 100: r = kernel_tex_image_interp(__tex_image_100, x, y); break;
+               case 101: r = kernel_tex_image_interp(__tex_image_101, x, y); break;
+               case 102: r = kernel_tex_image_interp(__tex_image_102, x, y); break;
+               case 103: r = kernel_tex_image_interp(__tex_image_103, x, y); break;
+               case 104: r = kernel_tex_image_interp(__tex_image_104, x, y); break;
+               case 105: r = kernel_tex_image_interp(__tex_image_105, x, y); break;
+               case 106: r = kernel_tex_image_interp(__tex_image_106, x, y); break;
+               case 107: r = kernel_tex_image_interp(__tex_image_107, x, y); break;
+               case 108: r = kernel_tex_image_interp(__tex_image_108, x, y); break;
+               case 109: r = kernel_tex_image_interp(__tex_image_109, x, y); break;
+               case 110: r = kernel_tex_image_interp(__tex_image_110, x, y); break;
+               case 111: r = kernel_tex_image_interp(__tex_image_111, x, y); break;
+               case 112: r = kernel_tex_image_interp(__tex_image_112, x, y); break;
+               case 113: r = kernel_tex_image_interp(__tex_image_113, x, y); break;
+               case 114: r = kernel_tex_image_interp(__tex_image_114, x, y); break;
+               case 115: r = kernel_tex_image_interp(__tex_image_115, x, y); break;
+               case 116: r = kernel_tex_image_interp(__tex_image_116, x, y); break;
+               case 117: r = kernel_tex_image_interp(__tex_image_117, x, y); break;
+               case 118: r = kernel_tex_image_interp(__tex_image_118, x, y); break;
+               case 119: r = kernel_tex_image_interp(__tex_image_119, x, y); break;
+               case 120: r = kernel_tex_image_interp(__tex_image_120, x, y); break;
+               case 121: r = kernel_tex_image_interp(__tex_image_121, x, y); break;
+               case 122: r = kernel_tex_image_interp(__tex_image_122, x, y); break;
+               case 123: r = kernel_tex_image_interp(__tex_image_123, x, y); break;
+               case 124: r = kernel_tex_image_interp(__tex_image_124, x, y); break;
+               case 125: r = kernel_tex_image_interp(__tex_image_125, x, y); break;
+               case 126: r = kernel_tex_image_interp(__tex_image_126, x, y); break;
+               case 127: r = kernel_tex_image_interp(__tex_image_127, x, y); break;
+               case 128: r = kernel_tex_image_interp(__tex_image_128, x, y); break;
+               case 129: r = kernel_tex_image_interp(__tex_image_129, x, y); break;
+               case 130: r = kernel_tex_image_interp(__tex_image_130, x, y); break;
+               case 131: r = kernel_tex_image_interp(__tex_image_131, x, y); break;
+               case 132: r = kernel_tex_image_interp(__tex_image_132, x, y); break;
+               case 133: r = kernel_tex_image_interp(__tex_image_133, x, y); break;
+               case 134: r = kernel_tex_image_interp(__tex_image_134, x, y); break;
+               case 135: r = kernel_tex_image_interp(__tex_image_135, x, y); break;
+               case 136: r = kernel_tex_image_interp(__tex_image_136, x, y); break;
+               case 137: r = kernel_tex_image_interp(__tex_image_137, x, y); break;
+               case 138: r = kernel_tex_image_interp(__tex_image_138, x, y); break;
+               case 139: r = kernel_tex_image_interp(__tex_image_139, x, y); break;
+               case 140: r = kernel_tex_image_interp(__tex_image_140, x, y); break;
+               case 141: r = kernel_tex_image_interp(__tex_image_141, x, y); break;
+               case 142: r = kernel_tex_image_interp(__tex_image_142, x, y); break;
+               case 143: r = kernel_tex_image_interp(__tex_image_143, x, y); break;
+               case 144: r = kernel_tex_image_interp(__tex_image_144, x, y); break;
+               case 145: r = kernel_tex_image_interp(__tex_image_145, x, y); break;
+               case 146: r = kernel_tex_image_interp(__tex_image_146, x, y); break;
+               case 147: r = kernel_tex_image_interp(__tex_image_147, x, y); break;
+               case 148: r = kernel_tex_image_interp(__tex_image_148, x, y); break;
+               case 149: r = kernel_tex_image_interp(__tex_image_149, x, y); break;
+               case 150: r = kernel_tex_image_interp(__tex_image_150, x, y); break;
+#endif
+
                default: 
                        kernel_assert(0);
                        return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
index 2a16b7b6c217b9948f16f99a6cb8adef0f01871d..4b48ee1d2c9fa988bd8228b076d230d24c0ee753 100644 (file)
@@ -98,6 +98,9 @@ void Pass::add(PassType type, vector<Pass>& passes)
                case PASS_TRANSMISSION_COLOR:
                        pass.components = 4;
                        break;
+               case PASS_SUBSURFACE_COLOR:
+                       pass.components = 4;
+                       break;
                case PASS_DIFFUSE_INDIRECT:
                        pass.components = 4;
                        pass.exposure = true;
@@ -113,6 +116,11 @@ void Pass::add(PassType type, vector<Pass>& passes)
                        pass.exposure = true;
                        pass.divide_type = PASS_TRANSMISSION_COLOR;
                        break;
+               case PASS_SUBSURFACE_INDIRECT:
+                       pass.components = 4;
+                       pass.exposure = true;
+                       pass.divide_type = PASS_SUBSURFACE_COLOR;
+                       break;
                case PASS_DIFFUSE_DIRECT:
                        pass.components = 4;
                        pass.exposure = true;
@@ -128,6 +136,11 @@ void Pass::add(PassType type, vector<Pass>& passes)
                        pass.exposure = true;
                        pass.divide_type = PASS_TRANSMISSION_COLOR;
                        break;
+               case PASS_SUBSURFACE_DIRECT:
+                       pass.components = 4;
+                       pass.exposure = true;
+                       pass.divide_type = PASS_SUBSURFACE_COLOR;
+                       break;
 
                case PASS_EMISSION:
                        pass.components = 4;
@@ -327,6 +340,10 @@ void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene)
                                kfilm->pass_transmission_color = kfilm->pass_stride;
                                kfilm->use_light_pass = 1;
                                break;
+                       case PASS_SUBSURFACE_COLOR:
+                               kfilm->pass_subsurface_color = kfilm->pass_stride;
+                               kfilm->use_light_pass = 1;
+                               break;
                        case PASS_DIFFUSE_INDIRECT:
                                kfilm->pass_diffuse_indirect = kfilm->pass_stride;
                                kfilm->use_light_pass = 1;
@@ -339,6 +356,10 @@ void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene)
                                kfilm->pass_transmission_indirect = kfilm->pass_stride;
                                kfilm->use_light_pass = 1;
                                break;
+                       case PASS_SUBSURFACE_INDIRECT:
+                               kfilm->pass_subsurface_indirect = kfilm->pass_stride;
+                               kfilm->use_light_pass = 1;
+                               break;
                        case PASS_DIFFUSE_DIRECT:
                                kfilm->pass_diffuse_direct = kfilm->pass_stride;
                                kfilm->use_light_pass = 1;
@@ -351,6 +372,10 @@ void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene)
                                kfilm->pass_transmission_direct = kfilm->pass_stride;
                                kfilm->use_light_pass = 1;
                                break;
+                       case PASS_SUBSURFACE_DIRECT:
+                               kfilm->pass_subsurface_direct = kfilm->pass_stride;
+                               kfilm->use_light_pass = 1;
+                               break;
 
                        case PASS_EMISSION:
                                kfilm->pass_emission = kfilm->pass_stride;
index 8e844bc788eff0004156a42b059f216bfc86b12e..65521103df19ea618af663e62e7898c65fd4f46b 100644 (file)
@@ -61,11 +61,16 @@ void ImageManager::set_osl_texture_system(void *texture_system)
        osl_texture_system = texture_system;
 }
 
-void ImageManager::set_extended_image_limits(void)
+void ImageManager::set_extended_image_limits(const DeviceInfo& info)
 {
-       tex_num_images = TEX_EXTENDED_NUM_IMAGES;
-       tex_num_float_images = TEX_EXTENDED_NUM_FLOAT_IMAGES;
-       tex_image_byte_start = TEX_EXTENDED_IMAGE_BYTE_START;
+       if(info.type == DEVICE_CPU) {
+               tex_num_images = TEX_EXTENDED_NUM_IMAGES_CPU;
+               tex_num_float_images = TEX_EXTENDED_NUM_FLOAT_IMAGES;
+               tex_image_byte_start = TEX_EXTENDED_IMAGE_BYTE_START;
+       }
+       else if ((info.type == DEVICE_CUDA || info.type == DEVICE_MULTI) && info.extended_images) {
+               tex_num_images = TEX_EXTENDED_NUM_IMAGES_GPU;
+       }
 }
 
 bool ImageManager::set_animation_frame_update(int frame)
index b20ff23fbbb7e0c185cc92b675837fbe7441b551..276420abea1665cc570ccaa4f3b43cccb9d4e9a6 100644 (file)
@@ -19,6 +19,7 @@
 #ifndef __IMAGE_H__
 #define __IMAGE_H__
 
+#include "device.h"
 #include "device_memory.h"
 
 #include "util_string.h"
 
 CCL_NAMESPACE_BEGIN
 
+/* Normal Image amount */
 #define TEX_NUM_IMAGES                 95
 #define TEX_IMAGE_BYTE_START   TEX_NUM_FLOAT_IMAGES
 
+/* Extended Image amount*/
 #define TEX_EXTENDED_NUM_FLOAT_IMAGES  5
-#define TEX_EXTENDED_NUM_IMAGES                        512
 #define TEX_EXTENDED_IMAGE_BYTE_START  TEX_EXTENDED_NUM_FLOAT_IMAGES
+#define TEX_EXTENDED_NUM_IMAGES_CPU            512
+#define TEX_EXTENDED_NUM_IMAGES_GPU            145
 
 /* color to use when textures are not found */
 #define TEX_IMAGE_MISSING_R 1
@@ -60,7 +64,7 @@ public:
 
        void set_osl_texture_system(void *texture_system);
        void set_pack_images(bool pack_images_);
-       void set_extended_image_limits(void);
+       void set_extended_image_limits(const DeviceInfo& info);
        bool set_animation_frame_update(int frame);
 
        bool need_update;
index a6dca62ffd0ada5fc4eec5fe3e2e0191d7834e38..feffa2a797196d4ff910fe891d22c3ec3478460b 100644 (file)
@@ -63,8 +63,8 @@ Scene::Scene(const SceneParams& params_, const DeviceInfo& device_info_)
        else
                shader_manager = ShaderManager::create(this, SceneParams::SVM);
 
-       if (device_info_.type == DEVICE_CPU)
-               image_manager->set_extended_image_limits();
+       /* Extended Image limits for CPU and Kepler GPUs */
+       image_manager->set_extended_image_limits(device_info_);
 }
 
 Scene::~Scene()
index 0790d4159c5a12a9e60033342833aa048917bece..8f5bc4ead950092ed939aae90cdeb4492a7caddf 100644 (file)
@@ -105,8 +105,8 @@ public:
        /* integrator */
        device_vector<uint> sobol_directions;
 
-       /* images */
-       device_vector<uchar4> tex_image[TEX_EXTENDED_NUM_IMAGES];
+       /* CPU images */
+       device_vector<uchar4> tex_image[TEX_EXTENDED_NUM_IMAGES_CPU];
        device_vector<float4> tex_float_image[TEX_EXTENDED_NUM_FLOAT_IMAGES];
 
        /* opencl images */
index 9551fad2fac3dc8888220ecd910dc0fed4b2540f..01d903c457be96f487850b4d298b5b15ae53d824 100644 (file)
Binary files a/release/datafiles/splash.png and b/release/datafiles/splash.png differ
index c604d16829ce6a5106e895002102e33bd2a83707..8b58493fe3a4a1b8e404ee214d1610104aabbab8 100644 (file)
Binary files a/release/datafiles/startup.blend and b/release/datafiles/startup.blend differ
index c151d47334e83bdc034d2c3885ceacdb155f0b25..71f859cd766c78e448662e78b9534951b4a1daf1 100644 (file)
@@ -806,6 +806,9 @@ void            ntreeGPUMaterialNodes(struct bNodeTree *ntree, struct GPUMateria
 #define RRES_OUT_TRANSM_DIRECT         25
 #define RRES_OUT_TRANSM_INDIRECT       26
 #define RRES_OUT_TRANSM_COLOR          27
+#define RRES_OUT_SUBS_DIRECT           28
+#define RRES_OUT_SUBS_INDIRECT         29
+#define RRES_OUT_SUBS_COLOR                    30
 
 /* note: types are needed to restore callbacks, don't change values */
 #define CMP_NODE_VIEWER                201
index 2aee5b4846a4cdc7e1207795be13b7b2b7fddf08..5c2e000d24d2ddfbc0f4ab4d088a87299f5c9840 100644 (file)
@@ -2253,7 +2253,8 @@ void node_light_path(
        out float is_singular_ray,
        out float is_reflection_ray,
        out float is_transmission_ray,
-       out float ray_length)
+       out float ray_length,
+       out float ray_depth)
 {
        is_camera_ray = 1.0;
        is_shadow_ray = 0.0;
@@ -2263,6 +2264,7 @@ void node_light_path(
        is_reflection_ray = 0.0;
        is_transmission_ray = 0.0;
        ray_length = 1.0;
+       ray_depth = 0.0;
 }
 
 void node_light_falloff(float strength, float tsmooth, out float quadratic, out float linear, out float constant)
index dd194ed389fa6b14f34a67ae262b7ae24cf0858a..5f1fc078adef1893577201275f8ed8f240c32ce6 100644 (file)
@@ -237,6 +237,9 @@ typedef struct SceneRenderLayer {
 #define SCE_PASS_TRANSM_DIRECT         (1<<25)
 #define SCE_PASS_TRANSM_INDIRECT       (1<<26)
 #define SCE_PASS_TRANSM_COLOR          (1<<27)
+#define SCE_PASS_SUBS_DIRECT           (1<<28)
+#define SCE_PASS_SUBS_INDIRECT         (1<<29)
+#define SCE_PASS_SUBS_COLOR                    (1<<30)
 
 /* note, srl->passflag is treestore element 'nr' in outliner, short still... */
 
index 64b4e019c27a1a28b211d71079b6951939659472..fe3219ce599b620c51a01b37e50b4bafd5fc310e 100644 (file)
@@ -570,6 +570,9 @@ static void rna_def_render_pass(BlenderRNA *brna)
                {SCE_PASS_TRANSM_DIRECT, "TRANSMISSION_DIRECT", 0, "Transmission Direct", ""},
                {SCE_PASS_TRANSM_INDIRECT, "TRANSMISSION_INDIRECT", 0, "Transmission Indirect", ""},
                {SCE_PASS_TRANSM_COLOR, "TRANSMISSION_COLOR", 0, "Transmission Color", ""},
+               {SCE_PASS_SUBS_DIRECT, "SUBSURFACE_DIRECT", 0, "Subsurface Direct", ""},
+               {SCE_PASS_SUBS_INDIRECT, "SUBSURFACE_INDIRECT", 0, "Subsurface Indirect", ""},
+               {SCE_PASS_SUBS_COLOR, "SUBSURFACE_COLOR", 0, "Subsurface Color", ""},
                {0, NULL, 0, NULL, NULL}
        };
        
index a0e1e29ab55b32aefa3f56dccf339b3f1d93760e..1ad2bfb491a23858d2f173fc227e9b602e773278 100644 (file)
@@ -2555,6 +2555,24 @@ void rna_def_render_layer_common(StructRNA *srna, int scene)
        RNA_def_property_ui_text(prop, "Transmission Color", "Deliver transmission color pass");
        if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+       
+       prop = RNA_def_property(srna, "use_pass_subsurface_direct", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SUBS_DIRECT);
+       RNA_def_property_ui_text(prop, "Subsurface Direct", "Deliver subsurface direct pass");
+       if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+
+       prop = RNA_def_property(srna, "use_pass_subsurface_indirect", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SUBS_INDIRECT);
+       RNA_def_property_ui_text(prop, "Subsurface Indirect", "Deliver subsurface indirect pass");
+       if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+
+       prop = RNA_def_property(srna, "use_pass_subsurface_color", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SUBS_COLOR);
+       RNA_def_property_ui_text(prop, "Subsurface Color", "Deliver subsurface color pass");
+       if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+       else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 }
 
 static void rna_def_freestyle_linesets(BlenderRNA *brna, PropertyRNA *cprop)
index 0d68b999eb2a2c0c28af87ad618a250cab74d8e3..5c656352a3c61ad9779d51f0ef8296486da2e46b 100644 (file)
@@ -72,6 +72,9 @@ static bNodeSocketTemplate cmp_node_rlayers_out[] = {
        {       SOCK_RGBA, 0, N_("Transmission Direct"),        0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
        {       SOCK_RGBA, 0, N_("Transmission Indirect"),      0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
        {       SOCK_RGBA, 0, N_("Transmission Color"),         0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+       {       SOCK_RGBA, 0, N_("Subsurface Direct"),          0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+       {       SOCK_RGBA, 0, N_("Subsurface Indirect"),        0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+       {       SOCK_RGBA, 0, N_("Subsurface Color"),           0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
        {       -1, 0, ""       }
 };
 
@@ -152,6 +155,13 @@ static void cmp_node_image_add_render_pass_outputs(bNodeTree *ntree, bNode *node
                cmp_node_image_add_render_pass_output(ntree, node, SCE_PASS_TRANSM_INDIRECT, RRES_OUT_TRANSM_INDIRECT);
        if (passflag & SCE_PASS_TRANSM_COLOR)
                cmp_node_image_add_render_pass_output(ntree, node, SCE_PASS_TRANSM_COLOR, RRES_OUT_TRANSM_COLOR);
+               
+       if (passflag & SCE_PASS_SUBS_DIRECT)
+               cmp_node_image_add_render_pass_output(ntree, node, SCE_PASS_SUBS_DIRECT, RRES_OUT_SUBS_DIRECT);
+       if (passflag & SCE_PASS_SUBS_INDIRECT)
+               cmp_node_image_add_render_pass_output(ntree, node, SCE_PASS_SUBS_INDIRECT, RRES_OUT_SUBS_INDIRECT);
+       if (passflag & SCE_PASS_SUBS_COLOR)
+               cmp_node_image_add_render_pass_output(ntree, node, SCE_PASS_SUBS_COLOR, RRES_OUT_SUBS_COLOR);
 }
 
 static void cmp_node_image_add_multilayer_outputs(bNodeTree *ntree, bNode *node, RenderLayer *rl)
@@ -414,6 +424,9 @@ void node_cmp_rlayers_force_hidden_passes(bNode *node)
        set_output_visible(node, passflag, RRES_OUT_TRANSM_DIRECT,    SCE_PASS_TRANSM_DIRECT);
        set_output_visible(node, passflag, RRES_OUT_TRANSM_INDIRECT,  SCE_PASS_TRANSM_INDIRECT);
        set_output_visible(node, passflag, RRES_OUT_TRANSM_COLOR,     SCE_PASS_TRANSM_COLOR);
+       set_output_visible(node, passflag, RRES_OUT_SUBS_DIRECT,      SCE_PASS_SUBS_DIRECT);
+       set_output_visible(node, passflag, RRES_OUT_SUBS_INDIRECT,    SCE_PASS_SUBS_INDIRECT);
+       set_output_visible(node, passflag, RRES_OUT_SUBS_COLOR,       SCE_PASS_SUBS_COLOR);
 }
 
 static void node_composit_init_rlayers(const bContext *C, PointerRNA *ptr)
index f719e09769d32cd3f4fdef985ddef46b290b0ced..c5c85f665f0fb6f9b2c557d608f516b7190fbd80 100644 (file)
@@ -279,6 +279,24 @@ static const char *get_pass_name(int passtype, int channel)
                if (channel == 1) return "TransCol.G";
                return "TransCol.B";
        }
+       if (passtype == SCE_PASS_SUBS_DIRECT) {
+               if (channel == -1) return "SubsDir";
+               if (channel == 0) return "SubsDir.R";
+               if (channel == 1) return "SubsDir.G";
+               return "SubsDir.B";
+       }
+       if (passtype == SCE_PASS_SUBS_INDIRECT) {
+               if (channel == -1) return "SubsInd";
+               if (channel == 0) return "SubsInd.R";
+               if (channel == 1) return "SubsInd.G";
+               return "SubsInd.B";
+       }
+       if (passtype == SCE_PASS_SUBS_COLOR) {
+               if (channel == -1) return "SubsCol";
+               if (channel == 0) return "SubsCol.R";
+               if (channel == 1) return "SubsCol.G";
+               return "SubsCol.B";
+       }
        return "Unknown";
 }
 
@@ -368,6 +386,15 @@ static int passtype_from_name(const char *str)
 
        if (strcmp(str, "TransCol") == 0)
                return SCE_PASS_TRANSM_COLOR;
+               
+       if (strcmp(str, "SubsDir") == 0)
+               return SCE_PASS_SUBS_DIRECT;
+
+       if (strcmp(str, "SubsInd") == 0)
+               return SCE_PASS_SUBS_INDIRECT;
+
+       if (strcmp(str, "SubsCol") == 0)
+               return SCE_PASS_SUBS_COLOR;
 
        return 0;
 }
@@ -538,6 +565,12 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf
                        render_layer_add_pass(rr, rl, 3, SCE_PASS_TRANSM_INDIRECT);
                if (srl->passflag  & SCE_PASS_TRANSM_COLOR)
                        render_layer_add_pass(rr, rl, 3, SCE_PASS_TRANSM_COLOR);
+               if (srl->passflag  & SCE_PASS_SUBS_DIRECT)
+                       render_layer_add_pass(rr, rl, 3, SCE_PASS_SUBS_DIRECT);
+               if (srl->passflag  & SCE_PASS_SUBS_INDIRECT)
+                       render_layer_add_pass(rr, rl, 3, SCE_PASS_SUBS_INDIRECT);
+               if (srl->passflag  & SCE_PASS_SUBS_COLOR)
+                       render_layer_add_pass(rr, rl, 3, SCE_PASS_SUBS_COLOR);
        }
        /* sss, previewrender and envmap don't do layers, so we make a default one */
        if (rr->layers.first == NULL && !(layername && layername[0])) {