Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/compositor/nodes/COM_DefocusNode.cpp')
-rw-r--r--source/blender/compositor/nodes/COM_DefocusNode.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/source/blender/compositor/nodes/COM_DefocusNode.cpp b/source/blender/compositor/nodes/COM_DefocusNode.cpp
index 461505871c6..4c6b3ad137b 100644
--- a/source/blender/compositor/nodes/COM_DefocusNode.cpp
+++ b/source/blender/compositor/nodes/COM_DefocusNode.cpp
@@ -46,6 +46,7 @@ void DefocusNode::convertToOperations(ExecutionSystem *graph, CompositorContext
NodeDefocus *data = (NodeDefocus *)node->storage;
NodeOperation *radiusOperation;
+ OutputSocket * depthOperation;
if (data->no_zbuf) {
MathMultiplyOperation *multiply = new MathMultiplyOperation();
SetValueOperation *multiplier = new SetValueOperation();
@@ -63,6 +64,7 @@ void DefocusNode::convertToOperations(ExecutionSystem *graph, CompositorContext
graph->addOperation(maxRadius);
graph->addOperation(minimize);
radiusOperation = minimize;
+ depthOperation = minimize->getOutputSocket(0);
}
else {
ConvertDepthToRadiusOperation *converter = new ConvertDepthToRadiusOperation();
@@ -72,6 +74,7 @@ void DefocusNode::convertToOperations(ExecutionSystem *graph, CompositorContext
this->getInputSocket(1)->relinkConnections(converter->getInputSocket(0), 1, graph);
graph->addOperation(converter);
radiusOperation = converter;
+ depthOperation = converter->getInputSocket(0)->getConnection()->getFromSocket();
}
BokehImageOperation *bokeh = new BokehImageOperation();
@@ -89,7 +92,15 @@ void DefocusNode::convertToOperations(ExecutionSystem *graph, CompositorContext
bokeh->setData(bokehdata);
bokeh->deleteDataOnFinish();
graph->addOperation(bokeh);
-
+
+#ifdef COM_DEFOCUS_SEARCH
+ InverseSearchRadiusOperation *search = new InverseSearchRadiusOperation();
+ addLink(graph, radiusOperation->getOutputSocket(0), search->getInputSocket(0));
+ addLink(graph, depthOperation, search->getInputSocket(1));
+ search->setMaxBlur(data->maxblur);
+ search->setThreshold(data->bthresh);
+ graph->addOperation(search);
+#endif
VariableSizeBokehBlurOperation *operation = new VariableSizeBokehBlurOperation();
if (data->preview) {
operation->setQuality(COM_QUALITY_LOW);
@@ -97,10 +108,14 @@ void DefocusNode::convertToOperations(ExecutionSystem *graph, CompositorContext
operation->setQuality(context->getQuality());
}
operation->setMaxBlur(data->maxblur);
+ operation->setbNode(node);
operation->setThreshold(data->bthresh);
addLink(graph, bokeh->getOutputSocket(), operation->getInputSocket(1));
addLink(graph, radiusOperation->getOutputSocket(), operation->getInputSocket(2));
- addLink(graph, radiusOperation->getInputSocket(0)->getConnection()->getFromSocket(), operation->getInputSocket(3));
+ addLink(graph, depthOperation, operation->getInputSocket(3));
+#ifdef COM_DEFOCUS_SEARCH
+ addLink(graph, search->getOutputSocket(), operation->getInputSocket(4));
+#endif
if (data->gamco) {
GammaCorrectOperation *correct = new GammaCorrectOperation();
GammaUncorrectOperation *inverse = new GammaUncorrectOperation();
@@ -115,6 +130,5 @@ void DefocusNode::convertToOperations(ExecutionSystem *graph, CompositorContext
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph);
this->getOutputSocket()->relinkConnections(operation->getOutputSocket());
}
-
graph->addOperation(operation);
}