nodes: moved matrix input on "video input" elsewhere

Rather than plugging a matrix into the video input node, the matrix is now
multiplied by the video input using a math node. This is probably more
sensible from a user perspective.

This also means the renderer is tolerant of texture sizes that are not equal
to the sequence size, however most nodes will downsample the texture to the
sequence size (and if not, it will be downsampled once it is cached). Textures
will still *always* be in reference space and the sequence's format. This seems
like the best compromise between backend and frontend congruity.
This commit is contained in:
itsmattkc
2020-04-27 04:11:24 +10:00
parent f61321d68b
commit ac3f49a845
26 changed files with 307 additions and 358 deletions
-4
View File
@@ -22,10 +22,6 @@
OLIVE_NAMESPACE_ENTER
AudioInput::AudioInput()
{
}
Node *AudioInput::copy() const
{
return new AudioInput();
+1 -2
View File
@@ -28,7 +28,7 @@ OLIVE_NAMESPACE_ENTER
class AudioInput : public MediaInput
{
public:
AudioInput();
AudioInput() = default;
virtual Node* copy() const override;
@@ -36,7 +36,6 @@ public:
virtual QString id() const override;
virtual QString Description() const override;
private:
};
OLIVE_NAMESPACE_EXIT
+1 -1
View File
@@ -67,7 +67,7 @@ NodeValueTable MediaInput::Value(NodeValueDatabase &value) const
}
// Push buffer to the top of the stack
NodeValue buffer = value[footage_input_].GetWithMeta(NodeParam::kSamples);
NodeValue buffer = value[footage_input_].GetWithMeta(NodeParam::kBuffer);
if (buffer.type() != NodeParam::kNone) {
table.Push(buffer);
}
-33
View File
@@ -31,12 +31,6 @@
OLIVE_NAMESPACE_ENTER
VideoInput::VideoInput()
{
matrix_input_ = new NodeInput("matrix_in", NodeInput::kMatrix);
AddInput(matrix_input_);
}
Node *VideoInput::copy() const
{
return new VideoInput();
@@ -57,31 +51,4 @@ QString VideoInput::Description() const
return tr("Import a video footage stream.");
}
NodeInput *VideoInput::matrix_input() const
{
return matrix_input_;
}
Node::Capabilities VideoInput::GetCapabilities(const NodeValueDatabase &) const
{
return kShader;
}
QString VideoInput::ShaderVertexCode(const NodeValueDatabase&) const
{
return ReadFileAsString(":/shaders/videoinput.vert");
}
QString VideoInput::ShaderFragmentCode(const NodeValueDatabase&) const
{
return ReadFileAsString(":/shaders/videoinput.frag");
}
void VideoInput::Retranslate()
{
MediaInput::Retranslate();
matrix_input_->set_name(tr("Transform"));
}
OLIVE_NAMESPACE_EXIT
+1 -14
View File
@@ -31,7 +31,7 @@ OLIVE_NAMESPACE_ENTER
class VideoInput : public MediaInput
{
public:
VideoInput();
VideoInput() = default;
virtual Node* copy() const override;
@@ -39,19 +39,6 @@ public:
virtual QString id() const override;
virtual QString Description() const override;
NodeInput* matrix_input() const;
virtual Capabilities GetCapabilities(const NodeValueDatabase&) const override;
virtual QString ShaderVertexCode(const NodeValueDatabase&) const override;
virtual QString ShaderFragmentCode(const NodeValueDatabase&) const override;
virtual void Retranslate() override;
protected:
private:
NodeInput* matrix_input_;
};
OLIVE_NAMESPACE_EXIT