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:
authorJeroen Bakker <j.bakker@atmind.nl>2012-05-21 14:20:30 +0400
committerJeroen Bakker <j.bakker@atmind.nl>2012-05-21 14:20:30 +0400
commit998a850f9f2747065ffe379097907232a85cd2d5 (patch)
treea4b86c8a1f10e1c39e7557edad82d2a55574ea62 /source/blender/compositor/nodes
parent14e4ad930209a3b861b5b514fbd23b39a7d16e94 (diff)
Added switch in dilate/erode between old (Step) and new (Distance)
algorithm Connected the Glare Fog Flow to use Fast Gaussian in stead of Bokeh blur
Diffstat (limited to 'source/blender/compositor/nodes')
-rw-r--r--source/blender/compositor/nodes/COM_DilateErodeNode.cpp41
-rw-r--r--source/blender/compositor/nodes/COM_GlareNode.cpp16
2 files changed, 40 insertions, 17 deletions
diff --git a/source/blender/compositor/nodes/COM_DilateErodeNode.cpp b/source/blender/compositor/nodes/COM_DilateErodeNode.cpp
index 2118f5b8e47..55759ba410f 100644
--- a/source/blender/compositor/nodes/COM_DilateErodeNode.cpp
+++ b/source/blender/compositor/nodes/COM_DilateErodeNode.cpp
@@ -33,16 +33,37 @@ DilateErodeNode::DilateErodeNode(bNode *editorNode): Node(editorNode)
void DilateErodeNode::convertToOperations(ExecutionSystem *graph, CompositorContext * context)
{
+
bNode *editorNode = this->getbNode();
- DilateErodeOperation *operation = new DilateErodeOperation();
- operation->setDistance(editorNode->custom2);
- operation->setInset(2.0f);
+ if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE) {
+ DilateErodeDistanceOperation *operation = new DilateErodeDistanceOperation();
+ operation->setDistance(editorNode->custom2);
+ operation->setInset(editorNode->custom3);
+
+ this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0));
- this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0));
-
- AntiAliasOperation * antiAlias = new AntiAliasOperation();
- addLink(graph, operation->getOutputSocket(), antiAlias->getInputSocket(0));
- this->getOutputSocket(0)->relinkConnections(antiAlias->getOutputSocket(0));
- graph->addOperation(operation);
- graph->addOperation(antiAlias);
+ if (editorNode->custom3 < 2.0f) {
+ AntiAliasOperation * antiAlias = new AntiAliasOperation();
+ addLink(graph, operation->getOutputSocket(), antiAlias->getInputSocket(0));
+ this->getOutputSocket(0)->relinkConnections(antiAlias->getOutputSocket(0));
+ graph->addOperation(antiAlias);
+ } else {
+ this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0));
+ }
+ graph->addOperation(operation);
+ } else {
+ if (editorNode->custom2 > 0) {
+ DilateStepOperation * operation = new DilateStepOperation();
+ operation->setIterations(editorNode->custom2);
+ this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0));
+ this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0));
+ graph->addOperation(operation);
+ } else {
+ ErodeStepOperation * operation = new ErodeStepOperation();
+ operation->setIterations(-editorNode->custom2);
+ this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0));
+ this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0));
+ graph->addOperation(operation);
+ }
+ }
}
diff --git a/source/blender/compositor/nodes/COM_GlareNode.cpp b/source/blender/compositor/nodes/COM_GlareNode.cpp
index c65adc862b1..e882c16814a 100644
--- a/source/blender/compositor/nodes/COM_GlareNode.cpp
+++ b/source/blender/compositor/nodes/COM_GlareNode.cpp
@@ -23,12 +23,12 @@
#include "COM_GlareNode.h"
#include "DNA_node_types.h"
#include "COM_FogGlowImageOperation.h"
-#include "COM_BokehBlurOperation.h"
#include "COM_GlareThresholdOperation.h"
#include "COM_GlareSimpleStarOperation.h"
#include "COM_GlareStreaksOperation.h"
#include "COM_SetValueOperation.h"
#include "COM_MixBlendOperation.h"
+#include "COM_FastGaussianBlurOperation.h"
GlareNode::GlareNode(bNode *editorNode): Node(editorNode)
{
@@ -70,29 +70,31 @@ void GlareNode::convertToOperations(ExecutionSystem *system, CompositorContext *
case 1: // fog glow
{
GlareThresholdOperation *thresholdOperation = new GlareThresholdOperation();
- FogGlowImageOperation * kerneloperation = new FogGlowImageOperation();
- BokehBlurOperation * bluroperation = new BokehBlurOperation();
+ FastGaussianBlurOperation* bluroperation = new FastGaussianBlurOperation();
SetValueOperation * valueoperation = new SetValueOperation();
SetValueOperation * mixvalueoperation = new SetValueOperation();
MixBlendOperation * mixoperation = new MixBlendOperation();
mixoperation->setResolutionInputSocketIndex(1);
this->getInputSocket(0)->relinkConnections(thresholdOperation->getInputSocket(0), true, 0, system);
addLink(system, thresholdOperation->getOutputSocket(), bluroperation->getInputSocket(0));
- addLink(system, kerneloperation->getOutputSocket(), bluroperation->getInputSocket(1));
- addLink(system, valueoperation->getOutputSocket(), bluroperation->getInputSocket(2));
+ addLink(system, valueoperation->getOutputSocket(), bluroperation->getInputSocket(1));
addLink(system, mixvalueoperation->getOutputSocket(), mixoperation->getInputSocket(0));
addLink(system, bluroperation->getOutputSocket(), mixoperation->getInputSocket(2));
addLink(system, thresholdOperation->getInputSocket(0)->getConnection()->getFromSocket(), mixoperation->getInputSocket(1));
thresholdOperation->setThreshold(glare->threshold);
- bluroperation->setSize(0.003f*glare->size);
+ NodeBlurData * data = new NodeBlurData();
+ data->relative = 0;
+ data->sizex = glare->size;
+ data->sizey = glare->size;
+ bluroperation->setData(data);
+ bluroperation->deleteDataWhenFinished();
bluroperation->setQuality(context->getQuality());
valueoperation->setValue(1.0f);
mixvalueoperation->setValue(0.5f+glare->mix*0.5f);
this->getOutputSocket()->relinkConnections(mixoperation->getOutputSocket());
system->addOperation(bluroperation);
- system->addOperation(kerneloperation);
system->addOperation(thresholdOperation);
system->addOperation(mixvalueoperation);
system->addOperation(valueoperation);