diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2012-07-03 13:05:19 +0400 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2012-07-03 13:05:19 +0400 |
commit | 2f5735a9d4745f33e850a163248c6c18a1305f64 (patch) | |
tree | a6f2712af50c9abcfc3c4853f0bda7c5e04df958 /source/blender/compositor/nodes/COM_LensDistortionNode.cpp | |
parent | 63810ffcef825930b034899f54107fc35b159349 (diff) |
Optimized the area of interest of the lensdistortion node.
This will have faster feedback to the user, as lensdistortion is mostly
a node that is located at the end of a composite
Diffstat (limited to 'source/blender/compositor/nodes/COM_LensDistortionNode.cpp')
-rw-r--r-- | source/blender/compositor/nodes/COM_LensDistortionNode.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/compositor/nodes/COM_LensDistortionNode.cpp b/source/blender/compositor/nodes/COM_LensDistortionNode.cpp index 0319e66ee22..bb431f86897 100644 --- a/source/blender/compositor/nodes/COM_LensDistortionNode.cpp +++ b/source/blender/compositor/nodes/COM_LensDistortionNode.cpp @@ -48,13 +48,21 @@ void LensDistortionNode::convertToOperations(ExecutionSystem *graph, CompositorC } else { ScreenLensDistortionOperation *operation = new ScreenLensDistortionOperation(); + operation->setData(data); + if (!(this->getInputSocket(1)->isConnected() || this->getInputSocket(2)->isConnected())) + { + // no nodes connected to the distortion and dispersion. We can precalculate some values + float distortion = ((const bNodeSocketValueFloat *)this->getInputSocket(1)->getbNodeSocket()->default_value)->value; + float dispersion = ((const bNodeSocketValueFloat *)this->getInputSocket(2)->getbNodeSocket()->default_value)->value; + operation->setDistortionAndDispersion(distortion, dispersion); + } this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, graph); this->getInputSocket(2)->relinkConnections(operation->getInputSocket(2), 2, graph); + this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0)); - operation->setData(data); graph->addOperation(operation); } |