Hey all, I suspect this will be a simple case of missing domain knowledge on my part but I am just curious why when I take my scene which looks like this:
When applying a basic compositing pass I am writing, it ends up looking like this?
The effect of mirroring is intentional (as I am writing a specific kind of mirroring pass), but the colour change seems random?
the Fragment shader of the pass looks like this:
uniform sampler2D tDiffuse;
uniform float direction;
uniform float position;
varying vec2 vUv;
void main() {
vec2 p = vec2(vUv.x, vUv.y);
if(direction == 0.0) {
if(vUv.x > position) {
p.x = (1.0 - vUv.x);
}
} else {
if(vUv.y > position) {
p.y = (1.0 - vUv.y);
}
}
vec4 color = texture2D(tDiffuse, p);
gl_FragColor = color;
}
The above is simply paired with a ShaderPass object and applied as a compositor effect!
Any ideas? Thanks