I'm writing a ShaderData plugin and what I want to do is sample a Fusion shader created programatically in the InitRender() function of my plugin.
I'm not even sure if this is feasible, but it doesn't work as expected. Here is the code to create the Fusion shader:
m_fusion = BaseShader::Alloc(Xfusion);
GeData gd;
if (m_fusion != nullptr)
{
m_fusionBlendShader = BaseShader::Alloc(Xcolor);
if (m_fusionBlendShader != nullptr)
{
m_fusionBlendShader->InitRender(irs);
gd.SetBaseList2D(m_fusionBlendShader);
const DescID blendID = ConstDescID(DescLevel(SLA_FUSION_BLEND_CHANNEL, DTYPE_BASELISTLINK, 0));
m_fusion->SetParameter(blendID, gd, DESCFLAGS_SET::NONE);
}
m_fusionBaseShader = BaseShader::Alloc(Xcolor);
if (m_fusionBaseShader != nullptr)
{
m_fusionBaseShader->InitRender(irs);
gd.SetBaseList2D(m_fusionBaseShader);
const DescID baseID = ConstDescID(DescLevel(SLA_FUSION_BASE_CHANNEL, DTYPE_BASELISTLINK, 0));
m_fusion->SetParameter(baseID, gd, DESCFLAGS_SET::NONE);
}
m_fusion->InitRender(irs);
m_fusionInitCount++;
}
I've just used color shaders in the Fusion blend and base channels for convenience; this should cause the Fusion to return pure white.
Everything seems to work as expected, in that it compiles and runs and the shaders are all allocated, but when I sample the Fusion shader in my shader's Output function, it always returns black. I'm not sure if this is because I haven't set the blend and base channels correctly or if this simply can't work, so any advice would be greatly appreciated.
Many thanks,
Steve