From 5fbeda7efd62e251dac2af881de9fe042f30a7a7 Mon Sep 17 00:00:00 2001 From: Monique Dewanchand Date: Fri, 1 Jun 2012 11:50:32 +0000 Subject: Optimize Gaussian blurs --- source/blender/compositor/nodes/COM_BlurNode.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'source/blender/compositor/nodes/COM_BlurNode.cpp') diff --git a/source/blender/compositor/nodes/COM_BlurNode.cpp b/source/blender/compositor/nodes/COM_BlurNode.cpp index 90b2481cc7d..b209e36dd48 100644 --- a/source/blender/compositor/nodes/COM_BlurNode.cpp +++ b/source/blender/compositor/nodes/COM_BlurNode.cpp @@ -37,10 +37,11 @@ void BlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext * c { bNode *editorNode = this->getbNode(); NodeBlurData * data = (NodeBlurData*)editorNode->storage; -#if 0 + InputSocket * inputSizeSocket = this->getInputSocket(1); + bool connectedSizeSocket = inputSizeSocket->isConnected(); + const bNodeSocket *sock = this->getInputSocket(1)->getbNodeSocket(); const float size = ((const bNodeSocketValueFloat*)sock->default_value)->value; -#endif CompositorQuality quality = context->getQuality(); @@ -71,6 +72,11 @@ void BlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext * c addLink(graph, operationx->getOutputSocket(), operationy->getInputSocket(0)); addLink(graph, operationx->getInputSocket(1)->getConnection()->getFromSocket(), operationy->getInputSocket(1)); addPreviewOperation(graph, operationy->getOutputSocket(), 5); + + if (!connectedSizeSocket) { + operationx->setSize(size); + operationy->setSize(size); + } } else { GaussianBokehBlurOperation *operation = new GaussianBokehBlurOperation(); @@ -81,5 +87,9 @@ void BlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext * c graph->addOperation(operation); this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket()); addPreviewOperation(graph, operation->getOutputSocket(), 5); + + if (!connectedSizeSocket) { + operation->setSize(size); + } } } -- cgit v1.2.3