port more nodes to use recursive jobs
This commit is contained in:
@@ -20,8 +20,11 @@
|
||||
|
||||
#include "noise.h"
|
||||
|
||||
#include "widget/slider/floatslider.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
const QString NoiseGeneratorNode::kBaseIn = QStringLiteral("base_in");
|
||||
const QString NoiseGeneratorNode::kColorInput = QStringLiteral("color_in");
|
||||
const QString NoiseGeneratorNode::kStrengthInput = QStringLiteral("strength_in");
|
||||
|
||||
@@ -29,9 +32,16 @@ const QString NoiseGeneratorNode::kStrengthInput = QStringLiteral("strength_in")
|
||||
|
||||
NoiseGeneratorNode::NoiseGeneratorNode()
|
||||
{
|
||||
AddInput(kStrengthInput, NodeValue::kFloat, 20);
|
||||
AddInput(kBaseIn, NodeValue::kTexture, InputFlags(kInputFlagNotKeyframable));
|
||||
|
||||
AddInput(kStrengthInput, NodeValue::kFloat, 0.2);
|
||||
SetInputProperty(kStrengthInput, QStringLiteral("view"), FloatSlider::kPercentage);
|
||||
SetInputProperty(kStrengthInput, QStringLiteral("min"), 0);
|
||||
|
||||
AddInput(kColorInput, NodeValue::kBoolean, false);
|
||||
|
||||
SetEffectInput(kBaseIn);
|
||||
SetFlags(kVideoEffect);
|
||||
}
|
||||
|
||||
Node* NoiseGeneratorNode::copy() const
|
||||
@@ -63,12 +73,13 @@ void NoiseGeneratorNode::Retranslate()
|
||||
{
|
||||
super::Retranslate();
|
||||
|
||||
SetInputName(kBaseIn, tr("Base"));
|
||||
SetInputName(kStrengthInput, tr("Strength"));
|
||||
SetInputName(kColorInput, tr("Color"));
|
||||
}
|
||||
|
||||
ShaderCode NoiseGeneratorNode::GetShaderCode(const QString& shader_id) const {
|
||||
Q_UNUSED(shader_id)
|
||||
ShaderCode NoiseGeneratorNode::GetShaderCode(const QString& shader_id) const
|
||||
{
|
||||
return ShaderCode(FileFunctions::ReadFileAsString(":/shaders/noise.frag"));
|
||||
}
|
||||
|
||||
@@ -79,8 +90,6 @@ void NoiseGeneratorNode::Value(const NodeValueRow &value, const NodeGlobals &glo
|
||||
job.InsertValue(value);
|
||||
job.InsertValue(QStringLiteral("time_in"), NodeValue(NodeValue::kFloat, globals.time().in().toDouble(), this));
|
||||
|
||||
|
||||
table->Push(NodeValue::kTexture, QVariant::fromValue(job), this);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user