miscellaneous shader changes

Since sequence resolution is provided to the nodes now, it no longer needs to be a global in the shaders
Removed some unused shaders
Added default params to ShaderCode to allow skipping types that aren't used
This commit is contained in:
itsmattkc
2020-11-22 10:31:37 +11:00
parent b9e0bfb679
commit 065fc9e10e
14 changed files with 81 additions and 140 deletions
+3 -1
View File
@@ -83,7 +83,7 @@ void BlurFilterNode::Retranslate()
ShaderCode BlurFilterNode::GetShaderCode(const QString &shader_id) const
{
Q_UNUSED(shader_id)
return ShaderCode(FileFunctions::ReadFileAsString(":/shaders/blur.frag"), QString());
return ShaderCode(FileFunctions::ReadFileAsString(":/shaders/blur.frag"));
}
NodeValueTable BlurFilterNode::Value(NodeValueDatabase &value) const
@@ -96,6 +96,8 @@ NodeValueTable BlurFilterNode::Value(NodeValueDatabase &value) const
job.InsertValue(horiz_input_, value);
job.InsertValue(vert_input_, value);
job.InsertValue(repeat_edge_pixels_input_, value);
job.InsertValue(QStringLiteral("resolution_in"),
ShaderValue(value[QStringLiteral("global")].Get(NodeParam::kVec2, QStringLiteral("resolution")), NodeParam::kVec2));
NodeValueTable table = value.Merge();
+4 -4
View File
@@ -28,11 +28,11 @@ MosaicFilterNode::MosaicFilterNode()
AddInput(tex_input_);
horiz_input_ = new NodeInput(QStringLiteral("horiz_in"), NodeParam::kFloat);
horiz_input_->set_property(QStringLiteral("min"), 1.0f);
horiz_input_->set_property(QStringLiteral("min"), 1.0);
AddInput(horiz_input_);
vert_input_ = new NodeInput(QStringLiteral("vert_in"), NodeParam::kFloat);
vert_input_->set_property(QStringLiteral("min"), 1.0f);
vert_input_->set_property(QStringLiteral("min"), 1.0);
AddInput(vert_input_);
}
@@ -51,7 +51,7 @@ NodeValueTable MosaicFilterNode::Value(NodeValueDatabase &value) const
job.InsertValue(horiz_input_, value);
job.InsertValue(vert_input_, value);
// Mipmapping makes this look weird
// Mipmapping makes this look weird, so we just use bilinear for finding the color of each block
job.SetInterpolation(tex_input_, Texture::kLinear);
NodeValueTable table = value.Merge();
@@ -75,7 +75,7 @@ ShaderCode MosaicFilterNode::GetShaderCode(const QString &shader_id) const
{
Q_UNUSED(shader_id)
return ShaderCode(FileFunctions::ReadFileAsString(":/shaders/mosaic.frag"), QString());
return ShaderCode(FileFunctions::ReadFileAsString(":/shaders/mosaic.frag"));
}
}
+3 -1
View File
@@ -91,6 +91,8 @@ NodeValueTable StrokeFilterNode::Value(NodeValueDatabase &value) const
job.InsertValue(radius_input_, value);
job.InsertValue(opacity_input_, value);
job.InsertValue(inner_input_, value);
job.InsertValue(QStringLiteral("resolution_in"),
ShaderValue(value[QStringLiteral("global")].Get(NodeParam::kVec2, QStringLiteral("resolution")), NodeParam::kVec2));
NodeValueTable table = value.Merge();
@@ -110,7 +112,7 @@ ShaderCode StrokeFilterNode::GetShaderCode(const QString &shader_id) const
{
Q_UNUSED(shader_id)
return ShaderCode(FileFunctions::ReadFileAsString(":/shaders/stroke.frag"), QString());
return ShaderCode(FileFunctions::ReadFileAsString(":/shaders/stroke.frag"));
}
}
+1 -1
View File
@@ -77,7 +77,7 @@ ShaderCode SolidGenerator::GetShaderCode(const QString &shader_id) const
{
Q_UNUSED(shader_id)
return ShaderCode(FileFunctions::ReadFileAsString(":/shaders/solid.frag"), QString());
return ShaderCode(FileFunctions::ReadFileAsString(":/shaders/solid.frag"));
}
}
+1 -1
View File
@@ -66,7 +66,7 @@ ShaderCode MergeNode::GetShaderCode(const QString &shader_id) const
{
Q_UNUSED(shader_id)
return ShaderCode(FileFunctions::ReadFileAsString(":/shaders/alphaover.frag"), QString());
return ShaderCode(FileFunctions::ReadFileAsString(":/shaders/alphaover.frag"));
}
NodeValueTable MergeNode::Value(NodeValueDatabase &value) const