Implemented Preview of defocus to set the quality of the node to Low
authorJeroen Bakker <j.bakker@atmind.nl>
Tue, 19 Jun 2012 13:52:41 +0000 (13:52 +0000)
committerJeroen Bakker <j.bakker@atmind.nl>
Tue, 19 Jun 2012 13:52:41 +0000 (13:52 +0000)
increased the inner loop of opencl

source/blender/compositor/intern/COM_NodeOperation.cpp
source/blender/compositor/nodes/COM_DefocusNode.cpp
source/blender/editors/space_node/drawnode.c
source/blender/makesrna/intern/rna_nodetree.c

index ac0f206..f416be5 100644 (file)
@@ -208,7 +208,7 @@ void NodeOperation::COM_clEnqueueRange(cl_command_queue queue, cl_kernel kernel,
        const int height = outputMemoryBuffer->getHeight();
        int offsetx;
        int offsety;
-       const int localSize = 32;
+       const int localSize = 128;
        size_t size[2];
        cl_int2 offset;
        
index 62a9693..4615058 100644 (file)
@@ -91,7 +91,11 @@ void DefocusNode::convertToOperations(ExecutionSystem *graph, CompositorContext
        graph->addOperation(bokeh);
        
        VariableSizeBokehBlurOperation *operation = new VariableSizeBokehBlurOperation();
-       operation->setQuality(context->getQuality());
+       if (data->preview) {
+               operation->setQuality(COM_QUALITY_LOW);
+       } else {
+               operation->setQuality(context->getQuality());
+       }
        operation->setMaxBlur(data->maxblur);
        operation->setThreshold(data->bthresh);
        addLink(graph, bokeh->getOutputSocket(), operation->getInputSocket(1));
index 4ed9acf..1ac069c 100644 (file)
@@ -1574,9 +1574,6 @@ static void node_composit_buts_defocus(uiLayout *layout, bContext *UNUSED(C), Po
 
        col = uiLayoutColumn(layout, 0);
        uiItemR(col, ptr, "use_preview", 0, NULL, ICON_NONE);
-       sub = uiLayoutColumn(col, 0);
-       uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_preview"));
-       uiItemR(sub, ptr, "samples", 0, NULL, ICON_NONE);
        
        col = uiLayoutColumn(layout, 0);
        uiItemR(col, ptr, "use_zbuffer", 0, NULL, ICON_NONE);
index 906f9cf..ef3dac5 100644 (file)
@@ -2562,15 +2562,9 @@ static void def_cmp_defocus(StructRNA *srna)
        
        prop = RNA_def_property(srna, "use_preview", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "preview", 1);
-       RNA_def_property_ui_text(prop, "Preview", "Enable sampling mode, useful for preview when using low samplecounts");
+       RNA_def_property_ui_text(prop, "Preview", "Enable low quality mode, useful for preview");
        RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
-       
-       prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
-       RNA_def_property_int_sdna(prop, NULL, "samples");
-       RNA_def_property_range(prop, 16, 256);
-       RNA_def_property_ui_text(prop, "Samples", "Number of samples (16=grainy, higher=less noise)");
-       RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
-       
+
        prop = RNA_def_property(srna, "use_zbuffer", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_negative_sdna(prop, NULL, "no_zbuf", 1);
        RNA_def_property_ui_text(prop, "Use Z-Buffer",