Gigatron
Thank you for your continued support;
When I view your online demo, the effect still looks like Multiply. When I put the effect in Construct2 - it does not show in the editor -the Sprite is pure black. When previewed in Nw.js, the sprite with the Effect becomes invisible - it does not affect anything.
What I tried to do is to understand and modify your shader - note that I have no idea on how to write GLSL shaders - I simply tried to comprehend the math logic.
I sort-of managed to get the effect working - in the Construct2 editor - here's an image to demonstrate:
If you preview the .capx, the effect looks pitch black, until you move the PaletteSprite around the scene (it's locked to the mouse position) - it seems to look fine when you move the mouse to the top left edge of the bottom SourceImage... What causes that problem is beyond me...
Here's the link to the modded .fx and the example .capx
https://we.tl/0elCj2hYH1
I changed the following:
in colormixer_MOD.xml:
<blends-background>true</blends-background> - this makes the effect preview in the editor.
in colormixer_MOD.fx:
replaced:
color.rgb = mix( color.rgb, texture2D(samplerFront, uv).rgb, intensity );
with:
color.rgb = texture2D(samplerFront, vec2(float (((color.r + color.g + color.b) / 3.0)*1.0), 0.5)).rgb;
^my hacky logic which sets the final pixel color to the PaletteSprite color at UV coordinates of U=intensity and V=0.5 (which as far as I understand can be any number - vertically the PaletteSprite pixels are identical)
The effect is almost there, I just don't have the knowledge to resolve the runtime glitching on my own.
Thanks again.