made vast improvements to rendering engine and node structure

This was many changes that were largely fundamentally related. They included:
- More const modifiers to enforce read only node graphs
- Support for fragment and vertex shaders from the nodes
- Support for node code loaded externally (embedded into the binary)
- Fixed issue preventing two textures from being used in a shader
- Removed several unused functions and cleaned up code
- Fixed video media node misreading its matrix input
This commit is contained in:
itsmattkc
2019-12-09 23:50:52 +11:00
parent daafcbfc95
commit 26b3993b9d
31 changed files with 287 additions and 233 deletions
+13 -16
View File
@@ -1,6 +1,7 @@
#include "video.h"
#include <QDebug>
#include <QMatrix4x4>
#include <QOpenGLPixelTransferOptions>
#include "core.h"
@@ -40,28 +41,24 @@ QString VideoInput::Description() const
return tr("Import a video footage stream.");
}
void VideoInput::Release()
{
MediaInput::Release();
}
NodeInput *VideoInput::matrix_input() const
{
return matrix_input_;
}
QString VideoInput::Code() const
bool VideoInput::IsAccelerated() const
{
return "#version 110\n"
"\n"
"varying vec2 v_texcoord;\n"
"\n"
"uniform sampler2D footage_in;\n"
"uniform mat4 matrix_in;\n"
"\n"
"void main(void) {\n"
" gl_FragColor = texture2D(footage_in, vec2(vec4(v_texcoord, 0.0, 1.0) * matrix_in));\n"
"}\n";
return true;
}
QString VideoInput::CodeVertex() const
{
return ReadFileAsString(":/shaders/videoinput.vert");
}
QString VideoInput::CodeFragment() const
{
return ReadFileAsString(":/shaders/videoinput.frag");
}
void VideoInput::Retranslate()
+3 -3
View File
@@ -18,11 +18,11 @@ public:
virtual QString Category() const override;
virtual QString Description() const override;
virtual void Release() override;
NodeInput* matrix_input() const;
virtual QString Code() const override;
virtual bool IsAccelerated() const override;
virtual QString CodeVertex() const override;
virtual QString CodeFragment() const override;
virtual void Retranslate() override;