Hello,
after wondering why my effect was not rendered properly on my object, I realized (after reading some threads on this forum) that the Waterbackground effect had to be applied first (as some sort of adjustment layer, like in After Effects).
To minimize the computational impact of the Waterbackground effect, I reduced it to this following effect, which I simply called Adjustment Layer:
////
// Adjustment Layer
////
varying mediump vec2 vTex;
uniform lowp sampler2D samplerBack;
void main(void)
{
gl_FragColor = texture2D(samplerBack, vTex);
}
[/code:1r5uh3wj]
If I put this Adjustment Layer Effect before my own Mirror Effect, everything is rendered properly. Here is the code for the Mirror Effect (please ignore strange output, still Work In Progress):
[code:1r5uh3wj]
////
// Mirror
////
varying mediump vec2 vTex;
uniform lowp sampler2D samplerBack;
void main()
{
lowp vec4 front = texture2D(samplerBack, vec2(vTex.x, abs(1.0 - vTex.y)));
front.rgb = mix(front.rgb, vec3(128.0, 180.0, 255.0) / 255.0, 0.15 + (0.25 - vTex.y) * 2.0);
gl_FragColor = front;
}
[/code:1r5uh3wj]
Now I would like to merge these two effects into one, so that I do not have to put the Adjustment Layer before this Mirror Effect. As I have VERY LITTLE knowledge in HLSL, I would like to ask you for help (and guidance if it is even possible to merge these two). Thank you!