Hi, I use HaxeFlixel for some game dev and am currently trying to port over a little lighting system that I wrote for an older version based on the blendmodes.
To do this, the only way seems to be with shaders, but I am having trouble passing in a second texture.
#pragma header
uniform sampler2D tex;
void main()
{
vec4 source= flixel_texture2D(tex, openfl_TextureCoordv);
vec4 other= texture2D(tex, openfl_TextureCoordv);
gl_FragColor = vec4(source.r * other.r, source.g * other.g, source.b * other.b, source.a);
}
Then, I create various HF things that are needed, including the shader and then pass in the bitmap data to the tex property of the shader.