Fix for #36823, SSS node now displays a warning, that it does not work on the GPU.
authorThomas Dinges <blender@dingto.org>
Fri, 27 Sep 2013 10:53:55 +0000 (10:53 +0000)
committerThomas Dinges <blender@dingto.org>
Fri, 27 Sep 2013 10:53:55 +0000 (10:53 +0000)
source/blender/editors/space_node/drawnode.c

index 308e9afa42fc6933025a2ea50f98164ae1c21e2a..913e48ebb7d9ab43e4df8c65922a645a6f85080b 100644 (file)
@@ -913,8 +913,16 @@ static void node_shader_buts_glossy(uiLayout *layout, bContext *UNUSED(C), Point
        uiItemR(layout, ptr, "distribution", 0, "", ICON_NONE);
 }
 
-static void node_shader_buts_subsurface(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
+static void node_shader_buts_subsurface(uiLayout *layout, bContext *C, PointerRNA *ptr)
 {
+       /* SSS does not work on GPU yet */
+       PointerRNA scene = CTX_data_pointer_get(C, "scene");
+       if (scene.data) {
+               PointerRNA cscene = RNA_pointer_get(&scene, "cycles");
+               if (cscene.data && RNA_enum_get(&cscene, "device") == 1)
+                       uiItemL(layout, IFACE_("SSS not supported on GPU"), ICON_NONE);
+       }
+
        uiItemR(layout, ptr, "falloff", 0, "", ICON_NONE);
 }