pass colortransformjob alpha setting to shader

This commit is contained in:
itsmattkc
2022-05-02 15:16:27 -07:00
parent abc669fa8e
commit 985131af55
4 changed files with 9 additions and 8 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ void ChromaKeyNode::Value(const NodeValueRow &value, const NodeGlobals &globals,
ColorTransformJob job;
job.InsertValue(value);
job.SetInputAlphaAssociation(AlphaAssociated::kAlphaAssociated);
job.SetAlphaChannelRequired(ColorTransformJob::kAlphaForceOn);
job.SetColorProcessor(processor());
job.SetInputTexture(value[kTextureInput].data().value<TexturePtr>());
job.SetNeedsCustomShader(this);
+2 -2
View File
@@ -24,7 +24,7 @@
#include <QMatrix4x4>
#include <QString>
#include "render/job/acceleratedjob.h"
#include "render/job/generatejob.h"
#include "render/alphaassoc.h"
#include "render/colorprocessor.h"
#include "render/texture.h"
@@ -33,7 +33,7 @@ namespace olive {
class Node;
class ColorTransformJob : public AcceleratedJob
class ColorTransformJob : public GenerateJob
{
public:
ColorTransformJob()
+1 -4
View File
@@ -219,10 +219,7 @@ void Renderer::BlitColorManaged(const ColorTransformJob &color_job, Texture *des
job.InsertValue(QStringLiteral("ove_cropmatrix"), NodeValue(NodeValue::kMatrix, color_job.GetCropMatrix().inverted()));
job.InsertValue(QStringLiteral("ove_maintex_alpha"), NodeValue(NodeValue::kInt, color_job.GetInputAlphaAssociation()));
job.InsertValue(color_job.GetValues());
//if (color_job.GetInputAlphaAssociation() == AlphaAssociated::kAlphaAssociated) {
job.SetAlphaChannelRequired(GenerateJob::kAlphaForceOn);
//}
job.SetAlphaChannelRequired(color_job.GetAlphaChannelRequired());
foreach (const ColorContext::LUT& l, color_ctx.lut3d_textures) {
job.InsertValue(l.name, NodeValue(NodeValue::kTexture, QVariant::fromValue(l.texture)));
+5 -1
View File
@@ -576,7 +576,11 @@ SampleBufferPtr RenderProcessor::ProcessSamples(const Node *node, const TimeRang
TexturePtr RenderProcessor::ProcessColorTransform(const Node *node, const ColorTransformJob &job)
{
TexturePtr src = job.GetInputTexture();
TexturePtr dest = render_ctx_->CreateTexture(src->params());
VideoParams src_params = src->params();
src_params.set_channel_count(GetChannelCountFromJob(job));
TexturePtr dest = render_ctx_->CreateTexture(src_params);
render_ctx_->BlitColorManaged(job, dest.get());