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:
@@ -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();
|
||||
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user