Solved issue with distorted compositor results in some cases
Originally issue was discovered when using stabilization and movie distortion nodes, but in fact issue was caused by render layer node always doing nearest interpolation. Now made it so this node will respect sampler passed to it's executePixel function and do an interpolation. Added two new functions to do bilinear/bicubic interpolation in float buffer with variable number of components per element, so it could interpolate 1, 3 and 4 component vectors. This functions currently mostly duplicates the same functions from imageprocess.c and it should actually be de-duplicated. Think it's ok to leave a bit of time with such duplication, since functions should be generalized one more time to support byte buffers, which could backfire on readability. Also removed mark as complex from stabilization node, which isn't needed sine int fact this node is not complex.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "COM_ExecutionSystem.h"
|
||||
#include "BKE_node.h"
|
||||
#include "COM_SetValueOperation.h"
|
||||
#include "COM_SetSamplerOperation.h"
|
||||
|
||||
ScaleNode::ScaleNode(bNode *editorNode) : Node(editorNode)
|
||||
{
|
||||
@@ -38,7 +39,9 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
|
||||
InputSocket *inputXSocket = this->getInputSocket(1);
|
||||
InputSocket *inputYSocket = this->getInputSocket(2);
|
||||
OutputSocket *outputSocket = this->getOutputSocket(0);
|
||||
BaseScaleOperation *scaleoperation;
|
||||
bNode *bnode = this->getbNode();
|
||||
|
||||
switch (bnode->custom1) {
|
||||
case CMP_SCALE_RELATIVE: {
|
||||
ScaleOperation *operation = new ScaleOperation();
|
||||
@@ -46,8 +49,8 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
|
||||
inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
|
||||
inputXSocket->relinkConnections(operation->getInputSocket(1), 1, graph);
|
||||
inputYSocket->relinkConnections(operation->getInputSocket(2), 2, graph);
|
||||
outputSocket->relinkConnections(operation->getOutputSocket(0));
|
||||
graph->addOperation(operation);
|
||||
|
||||
scaleoperation = operation;
|
||||
}
|
||||
break;
|
||||
case CMP_SCALE_SCENEPERCENT: {
|
||||
@@ -57,9 +60,9 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
|
||||
inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
|
||||
addLink(graph, scaleFactorOperation->getOutputSocket(), operation->getInputSocket(1));
|
||||
addLink(graph, scaleFactorOperation->getOutputSocket(), operation->getInputSocket(2));
|
||||
outputSocket->relinkConnections(operation->getOutputSocket(0));
|
||||
graph->addOperation(scaleFactorOperation);
|
||||
graph->addOperation(operation);
|
||||
|
||||
scaleoperation = operation;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -75,9 +78,9 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
|
||||
operation->setNewWidth(rd->xsch * rd->size / 100.0f);
|
||||
operation->setNewHeight(rd->ysch * rd->size / 100.0f);
|
||||
inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
|
||||
outputSocket->relinkConnections(operation->getOutputSocket(0));
|
||||
operation->getInputSocket(0)->getConnection()->setIgnoreResizeCheck(true);
|
||||
graph->addOperation(operation);
|
||||
|
||||
scaleoperation = operation;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -87,9 +90,12 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
|
||||
inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
|
||||
inputXSocket->relinkConnections(operation->getInputSocket(1), 1, graph);
|
||||
inputYSocket->relinkConnections(operation->getInputSocket(2), 2, graph);
|
||||
outputSocket->relinkConnections(operation->getOutputSocket(0));
|
||||
graph->addOperation(operation);
|
||||
|
||||
scaleoperation = operation;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
outputSocket->relinkConnections(scaleoperation->getOutputSocket(0));
|
||||
graph->addOperation(scaleoperation);
|
||||
}
|
||||
|
Reference in New Issue
Block a user