nodes: made changes to the node system to allow for context sensitive shader code
Primarily implemented for the math node so a new shader can be generated and compiled based on what inputs the node is receiving.
This commit is contained in:
@@ -45,17 +45,17 @@ NodeInput *VideoInput::matrix_input() const
|
||||
return matrix_input_;
|
||||
}
|
||||
|
||||
bool VideoInput::IsAccelerated() const
|
||||
Node::Capabilities VideoInput::GetCapabilities(const NodeValueDatabase &) const
|
||||
{
|
||||
return true;
|
||||
return kShader;
|
||||
}
|
||||
|
||||
QString VideoInput::AcceleratedCodeVertex() const
|
||||
QString VideoInput::ShaderVertexCode(const NodeValueDatabase&) const
|
||||
{
|
||||
return ReadFileAsString(":/shaders/videoinput.vert");
|
||||
}
|
||||
|
||||
QString VideoInput::AcceleratedCodeFragment() const
|
||||
QString VideoInput::ShaderFragmentCode(const NodeValueDatabase&) const
|
||||
{
|
||||
return ReadFileAsString(":/shaders/videoinput.frag");
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ public:
|
||||
|
||||
NodeInput* matrix_input() const;
|
||||
|
||||
virtual bool IsAccelerated() const override;
|
||||
virtual QString AcceleratedCodeVertex() const override;
|
||||
virtual QString AcceleratedCodeFragment() const override;
|
||||
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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user