Cycles / Hair rendering:
authorThomas Dinges <blender@dingto.org>
Wed, 8 May 2013 17:33:25 +0000 (17:33 +0000)
committerThomas Dinges <blender@dingto.org>
Wed, 8 May 2013 17:33:25 +0000 (17:33 +0000)
* Enable hair rendering on the GPU.

Patch by Stuart Broadfoot, with small tweaks by me, to only enable it on sm_20 and above.

intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_mesh.cpp
intern/cycles/kernel/kernel_types.h
intern/cycles/util/util_transform.h

index fcb0b680fdebfd7c63c63b08c7eafedf59c51b96..c3a717e0956564f0d700cbab4e776471cd844871 100644 (file)
@@ -1032,8 +1032,7 @@ class CyclesRender_PT_CurveRendering(CyclesButtonsPanel, Panel):
         scene = context.scene
         cscene = scene.cycles
         psys = context.particle_system
-        device_type = context.user_preferences.system.compute_device_type
-        experimental = ((cscene.feature_set == 'EXPERIMENTAL') and (cscene.device == 'CPU' or device_type == 'NONE'))
+        experimental = (cscene.feature_set == 'EXPERIMENTAL')
         return CyclesButtonsPanel.poll(context) and experimental and psys
 
     def draw_header(self, context):
@@ -1102,8 +1101,7 @@ class CyclesParticle_PT_CurveSettings(CyclesButtonsPanel, Panel):
         cscene = scene.cycles
         ccscene = scene.cycles_curves
         use_curves = ccscene.use_curves and context.particle_system
-        device_type = context.user_preferences.system.compute_device_type
-        experimental = cscene.feature_set == 'EXPERIMENTAL' and (cscene.device == 'CPU' or device_type == 'NONE')
+        experimental = cscene.feature_set == 'EXPERIMENTAL'
         return CyclesButtonsPanel.poll(context) and experimental and use_curves
 
     def draw(self, context):
index c545ad240c49acac9dbcc18e8925cdfd640b95a6..b144933bb2277a80c48cd3f39f59e6355062c0c0 100644 (file)
@@ -449,14 +449,14 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated, bool hide_tri
        mesh->name = ustring(b_ob_data.name().c_str());
 
        if(b_mesh) {
-               if(!(hide_tris && experimental && is_cpu)) {
+               if(!(hide_tris && experimental)) {
                        if(cmesh.data && experimental && RNA_boolean_get(&cmesh, "use_subdivision"))
                                create_subd_mesh(mesh, b_mesh, &cmesh, used_shaders);
                        else
                                create_mesh(scene, mesh, b_mesh, used_shaders);
                }
 
-               if(experimental && is_cpu)
+               if(experimental)
                        sync_curves(mesh, b_mesh, b_ob, object_updated);
 
                /* free derived mesh */
index fad1ee8f525b1c5baf213bb215a09c5685a63686..ee221db426755c21b333f482e4981cfb2ba1a724 100644 (file)
@@ -51,7 +51,6 @@ CCL_NAMESPACE_BEGIN
 #define __KERNEL_SHADING__
 #define __KERNEL_ADV_SHADING__
 #define __NON_PROGRESSIVE__
-#define __HAIR__
 #ifdef WITH_OSL
 #define __OSL__
 #endif
@@ -125,6 +124,7 @@ CCL_NAMESPACE_BEGIN
 #define __ANISOTROPIC__
 #define __CAMERA_MOTION__
 #define __OBJECT_MOTION__
+#define __HAIR__
 #endif
 //#define __SOBOL_FULL_SCREEN__
 
index 617ba43a5ed81bc1744173c35d87fceac48577ce..10120ed5fdb9d82dcf7ae9e51fe8043766dbb10d 100644 (file)
@@ -97,17 +97,6 @@ __device_inline float3 transform_direction_transposed(const Transform *t, const
        return make_float3(dot(x, a), dot(y, a), dot(z, a));
 }
 
-#ifndef __KERNEL_GPU__
-
-__device_inline void print_transform(const char *label, const Transform& t)
-{
-       print_float4(label, t.x);
-       print_float4(label, t.y);
-       print_float4(label, t.z);
-       print_float4(label, t.w);
-       printf("\n");
-}
-
 __device_inline Transform transform_transpose(const Transform a)
 {
        Transform t;
@@ -148,6 +137,17 @@ __device_inline Transform make_transform(float a, float b, float c, float d,
        return t;
 }
 
+#ifndef __KERNEL_GPU__
+
+__device_inline void print_transform(const char *label, const Transform& t)
+{
+       print_float4(label, t.x);
+       print_float4(label, t.y);
+       print_float4(label, t.z);
+       print_float4(label, t.w);
+       printf("\n");
+}
+
 __device_inline Transform transform_translate(float3 t)
 {
        return make_transform(