Shader looks like this:
shader Invert_Advanced_Internal_ShaderFX : ComputeFloat4, InvertOperations
{
[Default(0.0, 0.0, 0.0, 1.0)]
compose ComputeFloat4 ColorIn;
[Default(1.0)]
compose ComputeFloat Factor;
bool InvertAlpha = false;
int InvertType;
override float4 Compute()
{
return Invert(ColorIn.Compute(), Factor.Compute(), InvertAlpha, InvertType);
}
};
When I change InvertType in the patch it does not update in the shader, no matter if I use an enum, Enum2Ord or an integer directly.
It works though if the int is changed inside the code, for example by setting a default, like so:
int InvertType = 2;
Same thing as TextureFX works without problems.
shader Invert_Internal_TextureFX : FilterBase, InvertOperations
{
[Default(1.0)]
compose ComputeFloat Factor;
bool InvertAlpha = false;
int InvertType;
float4 Filter(float4 tex0col)
{
return Invert(tex0col, Factor.Compute(), InvertAlpha, InvertType);
}
};
SFX-Int.7z (33.3 KB)