Hi @tonfilm, that cast exception appears with FilterBase
.
Once I do TextureFX like this it works out well:
shader Invertfxr_TextureFX : TextureFX
{
float Factor = 1;
bool Invert = true;
bool InvertRGB = false;
bool InvertTest = false;
bool InvertAlpha = false;
override stage void PSMain()
{
float4 c = InTex();
float4 e = c;
if (Invert) e.rgb = 1 - e.rgb;
if (InvertRGB) e.rgb -= 2 * (e.rgb - dot(e.rgb,1) / 3.); // ohh this is the cutest
if (InvertAlpha) e.a = 1 - e.a;
c.rgb = lerp(c, e, Factor);
streams.ColorTarget = c;
}
};
It’s hard to debug - you always need a second PC to run the build.
Should it go here?